plannet

command module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2025 License: MIT Imports: 3 Imported by: 0

README ΒΆ

Plannet - LLM-Powered Planning Assistant

Plannet is a command-line tool that helps you stay on top of your workload and backlog from where you work, the command line.

You can bring your own LLM, or use ours at https://www.plannet.dev/

Features

  • πŸ€– LLM integration for content generation
  • 🎫 Optional Jira integration
  • 🎨 Rich terminal UI for ticket selection
  • βš™οΈ Configurable to bring your own model
  • πŸ“‹ Clipboard integration with customizable behavior

Installation

Prerequisites
  • Go 1.19 or later
  • A Jira account (optional)
  • Access to an LLM API endpoint
Quick Install
# Download the latest release for your platform
# For macOS (Intel):
curl -L https://github.com/plannet-dev/plannet/releases/latest/download/plannet-darwin-amd64 -o plannet
# For macOS (Apple Silicon):
curl -L https://github.com/plannet-dev/plannet/releases/latest/download/plannet-darwin-arm64 -o plannet
# For Linux:
curl -L https://github.com/plannet-dev/plannet/releases/latest/download/plannet-linux-amd64 -o plannet
# For Windows:
curl -L https://github.com/plannet-dev/plannet/releases/latest/download/plannet-windows-amd64.exe -o plannet.exe

# Add to PATH based on your operating system:

# For macOS/Linux:
# Option 1: Move to /usr/local/bin (recommended)
sudo mv plannet /usr/local/bin/

# Option 2: Add to PATH in your shell configuration
# For bash/zsh (add to ~/.bashrc or ~/.zshrc):
export PATH=$PATH:$(pwd)
# For fish (add to ~/.config/fish/config.fish):
set -gx PATH $PATH (pwd)

# For Windows:
# Option 1: Move to a directory in your PATH (e.g., C:\Windows)
move plannet.exe C:\Windows\

# Option 2: Add directory to PATH
# 1. Open System Properties > Advanced > Environment Variables
# 2. Under "User variables", find and select "Path"
# 3. Click "Edit" and add the directory containing plannet.exe
# 4. Click "OK" to save

# Verify installation
plannet --version
Building from Source
# Clone the repository
git clone https://github.com/plannet-ai/plannet.git
cd plannet

# Install dependencies
go mod download

# Build the binary
./build.sh

Configuration

Create a .plannetrc file in your home directory with the following structure:

{
  "base_url": "http://localhost:1234/v1/completions",
  "model": "your-model-name",
  "system_prompt": "Optional system prompt to guide the LLM",
  "headers": {
    "Authorization": "Bearer your-token"
  },
  "jira_url": "https://your-instance.atlassian.net",
  "jira_token": "your-jira-token",
  "jira_user": "your-email@company.com",
  "copy_preference": "ask-every-time"
}
Configuration Fields
  • Required Fields:

    • base_url: The LLM API endpoint
    • model: The model identifier to use
    • headers: API authentication headers
  • Optional Fields:

    • system_prompt: A prompt that guides the LLM's behavior
    • jira_url: Your Jira instance URL
    • jira_token: Your Jira API token
    • jira_user: Your Jira username/email
    • copy_preference: How to handle clipboard copying (options: ask-every-time, ask-once, copy-automatically, do-not-copy)

Usage

Basic Usage
# Generate content with a custom prompt
plannet --prompt "Generate a test plan for a login feature"

# Use the generate command
plannet generate "Generate a test plan for a login feature"

# Use Jira integration (if configured)
plannet jira list

# Show version information
plannet --version

# Enable debug mode
plannet --debug
Using with Jira

When Jira integration is configured, Plannet will:

  1. Fetch your assigned tickets
  2. Present an interactive selection interface
  3. Use the selected ticket's information to generate content
  4. Optionally append your custom prompt
Output Management
  • Generated content is displayed in the terminal
  • Option to copy output to clipboard
  • Color-coded output for better readability
  • Configurable clipboard behavior

Development

Project Structure
.
β”œβ”€β”€ main.go          # Application entry point
β”œβ”€β”€ cmd/             # Command implementations using Cobra
β”‚   β”œβ”€β”€ root.go      # Root command definition
β”‚   β”œβ”€β”€ jira.go      # Jira-related commands
β”‚   β”œβ”€β”€ track.go     # Work tracking commands
β”‚   β”œβ”€β”€ generate.go  # Content generation command
β”‚   └── ...          # Other command files
β”œβ”€β”€ config/          # Configuration management
β”‚   β”œβ”€β”€ config.go    # Configuration struct and functions
β”‚   β”œβ”€β”€ copy_preference.go # Clipboard preference handling
β”‚   └── config_test.go # Configuration tests
β”œβ”€β”€ llm/             # LLM interaction
β”‚   └── generator.go # LLM request handling
β”œβ”€β”€ output/          # Output management
β”‚   └── output.go    # Output display and clipboard handling
β”œβ”€β”€ build/           # Build output directory
β”œβ”€β”€ build.sh         # Build script
└── test_track.sh    # Test script for tracking feature

Note: The src/ directory contains an old implementation that is no longer used. See src/README.md for details.

Adding New Features
  1. Create a new command file in the cmd/ directory
  2. Add your command to the root command in cmd/root.go
  3. Update the README.md with new features
Running Tests
go test ./...

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Plannet

Plannet is a command-line tool for managing your daily tasks and projects. It integrates with various services like Jira and LLMs to help you stay organized and productive.

Features

  • Task management with ticket prefixes
  • Jira integration for viewing and creating tickets
  • LLM integration for getting help with tasks
  • Git integration for managing branches
  • Secure storage for API tokens
  • Rate limiting for API calls
  • Input validation and file path sanitization

Installation

Prerequisites
  • Go 1.21 or later
  • Git (optional, for git integration)
Building from Source
  1. Clone the repository:
git clone https://github.com/plannet-ai/plannet.git
cd plannet
  1. Build the project:
go build
  1. Add plannet to your PATH:
# For bash/zsh (add to ~/.bashrc or ~/.zshrc)
export PATH=$PATH:$(pwd)

# For fish (add to ~/.config/fish/config.fish)
set -gx PATH $PATH (pwd)

Usage

Initial Setup

Run the initialization command to set up your configuration:

plannet init

This will guide you through setting up:

  • Ticket prefixes for your projects
  • Editor preferences
  • Git integration settings
  • Jira integration
  • LLM integration
Managing Tasks

Create a new task:

plannet task "Implement user authentication"

List your tasks:

plannet list
Jira Integration

View your Jira tickets:

plannet jira list

View a specific ticket:

plannet jira view PROJ-123

Create a new ticket:

plannet jira create
LLM Integration

Start an interactive session with the LLM:

plannet llm

Send a single prompt:

plannet llm --prompt "How do I implement rate limiting in Go?"

Configuration

The configuration file is stored at ~/.plannetrc. It contains your preferences and settings for various integrations.

Security

Plannet implements several security features:

  • Secure storage for API tokens using AES-GCM encryption
  • Rate limiting for API calls to prevent abuse
  • Input validation to prevent injection attacks
  • File path sanitization to prevent path traversal attacks

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Directories ΒΆ

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL