summaryrefslogtreecommitdiff
path: root/cmd
AgeCommit message (Collapse)Author
2026-03-27release: v0.27.2v0.27.2mainPaul Buetow
2026-03-23fix: prevent ask add from swallowing tags into descriptions, add ↵v0.25.11Paul Buetow
rc.confirmation=off parseAddArgs now rejects args that start with '+'/'-' but contain spaces as modifiers — those are description text, not tags (tags cannot have spaces). This prevents agents from quoting tag+description together and having the tag silently land in the task description with no tag applied. Also removed the fallthrough that duplicated all-modifier args as description. Added rc.confirmation=off to every taskwarrior invocation so that write operations (done, delete, start, etc.) succeed non-interactively when stdin is unavailable (as is always the case when called from an agent). Bump version to v0.25.11. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23fix: address all HIGH-severity code quality audit findingsPaul Buetow
- lsp/server.go: track request goroutines in inflight WaitGroup to prevent use-after-close writes on shutdown - lsp/llm_client_registry.go: acquire write lock before calling build() to eliminate TOCTOU race on cache population - lsp/handlers_codeaction.go: resolveSimplifyCodeAction now uses PromptCodeActionSimplify{System,User} (was wrongly using rewrite prompts) - askcli/taskexport.go: remove exported MustParseTaskExport to prevent panic on malformed external input; move to unexported test helper - cmd/ask/main.go: print error to stderr before os.Exit - llm/{openai,ollama,openrouter}.go: add interface satisfaction assertions - integrationtests/ask_test.go: replace type assertions with errors.As for robust exec.ExitError unwrapping Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23ask add: always emit UUID, never the numeric task IDPaul Buetow
Use rc.verbose=new-uuid so taskwarrior prints "Created task <uuid>." directly on stdout. Parse the UUID from that line instead of doing a two-step numeric-ID lookup or falling back to an export call. Removes ExtractUUIDFromOutput (which could leak numeric IDs) and fetchUUIDByNumericID (the export fallback). Integration tests now get the UUID straight from ask add output without any extra calls. Also fixes TestMain_WiresDispatcher which expected "export" first in args, but list now prepends status:pending filter. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22ask: fix filter argument ordering for list/all/ready commandsv0.25.4Paul Buetow
Filters like +tag must come before the 'export' action in task commands. Previously filters were appended after 'export' causing 'ask list +integrationtest' to fail.
2026-03-22ask list: only show pending tasks by defaultv0.25.3Paul Buetow
Add status:pending filter to list command so it only shows pending tasks, not completed or deleted ones. Use 'ask all' to see all tasks.
2026-03-22cmd/ask: wire to askcli.Dispatch, remove taskproxy passthroughPaul Buetow
2026-03-22Remove 'hexai task' subcommand; task management is fully handled by the ↵Paul Buetow
'ask' command Amp-Thread-ID: https://ampcode.com/threads/T-019d1407-6145-7534-b780-29a2559d06c5 Co-authored-by: Amp <amp@ampcode.com>
2026-03-19Add ask Taskwarrior wrapperPaul Buetow
2026-03-19Add hexai task proxy dispatch testsPaul Buetow
2026-03-19Add Taskwarrior task proxy subcommandPaul Buetow
2026-03-16Replace Summary: prefixes with standard Go package doc commentsPaul Buetow
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16Use filepath.Join instead of fmt.Sprintf for path constructionPaul Buetow
Replace string-based path building with filepath.Join in LSP and MCP server log path helpers for platform-correct path separators. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16Decompose App God struct into embedded section structsPaul Buetow
Replace 60+ flat fields in App with 4 embedded section structs: CoreConfig, ProviderConfig, PromptConfig, FeatureConfig. Go field promotion preserves all existing field access patterns. Updated flattenAppConfig to recurse into embedded structs for runtimeconfig. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16Remove os.Setenv from MCP server production codePaul Buetow
Replace environment variable communication between cmd and internal packages with explicit MCPOverrides struct. CLI flag values are now passed via typed struct fields through Run/RunWithFactory/RunBackfill. Env var support preserved through appconfig's applyMCPEnv pipeline. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16Replace panic with graceful error returns in tmuxedit and mcp-serverPaul Buetow
Change initDebugLog() and defaultLogPath() to return errors instead of panicking. Callers now handle errors gracefully with proper messages. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16Release v0.24.0v0.24.0Paul Buetow
Bring unit test coverage from ~75% to 85.1% project-wide. All internal packages now exceed 80% coverage. Refactored cmd entrypoints to extract testable run() functions with injectable seams. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13release: v0.22.0v0.22.0Paul Buetow
2026-03-10task 80330fc4: deduplicate default config path helperPaul Buetow
2026-03-10task dac9b1e5: avoid LSP startup panic on StateDir failurePaul Buetow
2026-02-13chore: deprecate hexai-mcp-server as experimentalPaul Buetow
Add deprecation notices across hexai-mcp-server codebase and documentation. The MCP server is now considered experimental and not actively maintained, as prompts are managed through slash commands and meta-commands instead. Changes: - Add runtime deprecation warning to stderr on binary startup - Mark feature as deprecated in README.md - Add deprecation notices to all 8 MCP documentation files - Add deprecation log message to run.go - Update Magefile.go build comment The code remains fully functional but warns users of its experimental status. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-12Rename hexai-lsp command to hexai-lsp-serverPaul Buetow
Amp-Thread-ID: https://ampcode.com/threads/T-019c50bc-2906-77db-a31e-0d553338d99b Co-authored-by: Amp <amp@ampcode.com>
2026-02-12feat: add automatic MCP prompt to slash command syncingPaul Buetow
Adds optional syncing of MCP prompts to Markdown slash command files for AI agents that don't yet support MCP prompts (e.g., Cursor IDE). Features: - Syncs prompts on create/update/delete operations - Configurable via TOML config, environment vars, or CLI flags - Backfill support with --sync-all flag - Thread-safe atomic file writes - Non-fatal sync failures (logged but don't break operations) - Comprehensive test coverage (81.1% total) Configuration: - Config: [mcp] slashcommand_sync = true, slashcommand_dir = "~/.cursor/commands" - Env: HEXAI_MCP_SLASHCOMMAND_SYNC, HEXAI_MCP_SLASHCOMMAND_DIR - CLI: --slashcommand-sync, --slashcommand-dir, --sync-all Fixes config merging bug where project config would reset global MCP settings. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-10Add MCP server implementation with comprehensive test coveragePaul Buetow
Implements a full Model Context Protocol (MCP) server for managing and serving prompts to LLM applications. The server provides CRUD operations for prompts with automatic backups and template rendering support. Key additions: - cmd/hexai-mcp-server: Main MCP server binary entrypoint - internal/hexaimcp: Server orchestrator with configuration and setup - internal/mcp: Core MCP protocol implementation (JSON-RPC 2.0) - internal/promptstore: Prompt storage with JSONL backend and automatic backups - Comprehensive test suites achieving 80%+ coverage for all MCP packages - Magefile targets for building and installing the MCP server - Complete documentation for setup, API, prompts, and backups Test coverage: - internal/hexaimcp: 84.3% - internal/mcp: 80.3% - internal/promptstore: 81.2% - Overall project: 81.5% Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-10Add tmux popup history storage and consolidate state files to XDG_STATE_HOMEPaul Buetow
- Add StateDir() helper function respecting XDG_STATE_HOME (~/.local/state/hexai/) - Implement JSONL-based history storage for tmux popup submissions - New history.go with AppendHistory() and GetHistory() functions - Store timestamp, agent name, cwd, and submitted text - Comprehensive unit tests for history functionality - Integrate history append into tmux edit workflow after successful submission - Move logs from /tmp/ to persistent state directory: - hexai-lsp.log: ~/.local/state/hexai/hexai-lsp.log - hexai-tmux-edit.log: ~/.local/state/hexai/hexai-tmux-edit.log - Update README.md with File Locations section documenting XDG directories - Fix pre-existing test failures by isolating project config in unit tests - Panic on state directory creation failure instead of silent fallback All unit tests pass. Follows XDG Base Directory Specification for proper state file management with persistence across reboots. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-10Fix hexai-tmux-edit to open in current working directoryPaul Buetow
hexai-tmux-edit was opening in the wrong directory because the tmux popup wasn't being told which directory to use. This fix: - Updates bind-key example to cd into pane's current path - Passes working directory to popup via -d flag using os.Getwd() - Updates all documentation with corrected bind-key examples Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-08add hexai-tmux-edit: tmux popup editor for AI agent promptsPaul Buetow
New tool that opens $EDITOR in a tmux popup for composing longer prompts when working with AI CLI agents (Claude Code, Cursor, Amp, Aider, etc.). Captures existing prompt text from the target pane, pre-fills the editor, and sends edited text back via tmux send-keys. Config-driven agent detection via regex patterns in [tmux_edit] config section. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06Remove GitHub Copilot provider supportpaul@buetow.org
Remove all GitHub Copilot integration from the codebase to streamline the supported provider set to OpenAI, OpenRouter, Anthropic, and Ollama. Changes: - Delete core Copilot implementation (copilot.go) and all related tests - Remove Copilot configuration fields from App struct and Config - Remove Copilot from provider factory and API key handling - Update all test files to replace Copilot references with other providers - Remove Copilot documentation from README, configuration guide, and examples - Remove Copilot section from config.toml.example All tests pass successfully after removal. Co-authored-by: Cursor <cursoragent@cursor.com>
2026-01-30fix: restore corrupted cmd/hexai/main.go from commit 6103208feature/anthropic-api-providerPaul Buetow
Amp-Thread-ID: https://ampcode.com/threads/T-019c0e27-1598-778e-ad3b-fa43ce6e7073 Co-authored-by: Amp <amp@ampcode.com>
2026-01-29feat: add native Anthropic API provider supportPaul Buetow
- Implement new anthropicClient with full Client interface - Add Streamer interface for token-by-token streaming via SSE - Add Anthropic Messages API v1 integration with proper headers - Support claude-3-5-sonnet-20241022 as default model - Add configuration via [anthropic] TOML section - Add environment variable overrides (HEXAI_ANTHROPIC_*) - Support both HEXAI_ANTHROPIC_API_KEY and ANTHROPIC_API_KEY fallback - Integrate Anthropic key handling in LSP, CLI, and llmutils - Update provider factory to support 'anthropic' provider name - Add 11 comprehensive unit tests for Anthropic client - Update config.toml.example with [anthropic] section - Update NewFromConfig() signature to accept anthropicAPIKey parameter - All 51 internal LLM tests pass (11 new Anthropic tests + 40 existing) Anthropic models can be accessed via: [anthropic] model = "claude-3-5-sonnet-20241022" base_url = "https://api.anthropic.com/v1" temperature = 0.2 or environment: export HEXAI_PROVIDER="anthropic" export HEXAI_ANTHROPIC_API_KEY="your-key" Amp-Thread-ID: https://ampcode.com/threads/T-019c0af1-f215-72cf-9940-b014b1a9576b Co-authored-by: Amp <amp@ampcode.com>
2025-11-02some linter fixesPaul Buetow
2025-09-28Document config defaults in CLI helpPaul Buetow
2025-09-28Propagate --config overrides through CLI tools and LSP reloadsPaul Buetow
2025-09-28Add --config flag support across CLI, LSP, and tmux toolsPaul Buetow
2025-09-28Improve multi-provider completion streaming and CLI selector flagsPaul Buetow
2025-09-08docs: move tmux documentation to its own filePaul Buetow
2025-09-07feat: rename hexai-action -> hexai-tmux-action; remove --tmux/--no-tmux; ↵Paul Buetow
tmux-only flow; update docs and Magefile
2025-09-07refactor: move hexai-action to cmd/hexai-action; extract orchestration into ↵Paul Buetow
internal/hexaiaction; move tests; update Magefile and docs
2025-09-07tiding upPaul Buetow
2025-09-06feat(hexai-action): add --infile/--outfile flags; docs and tests\n\n- Add ↵Paul Buetow
flags to read from file and write to file\n- Refactor IO open into helper for testability\n- Add CLI integration-style test for IO\n- Update README and docs/usage.md with examples\n- Update docs/testing.md with instructions
2025-09-06more testsPaul Buetow
2025-08-31module: set module path to codeberg.org/snonux/hexai; update imports; docs: ↵v0.3.4Paul Buetow
add go install instructions
2025-08-17refactor as per manual code reviewsPaul Buetow
2025-08-17feat: Support XDG config homePaul Buetow
This change implements support for the XDG Base Directory Specification for the configuration file. The configuration file is now read from `$XDG_CONFIG_HOME/hexai/config.json` if the `XDG_CONFIG_HOME` environment variable is set. If it is not set, it falls back to the previous location, `$HOME/.config/hexai/config.json`. This change also includes: - A fix for a bug in the test suite where a test was failing due to an environment variable being set. - Updates to the documentation to reflect the new configuration file location. - A version bump to 0.1.0.
2025-08-17cli+lsp: refactor main packages into internal runners; add testsPaul Buetow
- Move CLI logic to internal/hexaicli with Run/RunWithClient - Move LSP logic to internal/hexailsp with Run/RunWithFactory - Extract helpers; keep behavior identical for both binaries - Add unit tests for hexaicli (input parsing, messages, streaming) and hexailsp (factory wiring, client creation, logging settings) - Add top-of-file summaries and 'Not yet reviewed by a human' comments to all Go files - Update README with internal package docs
2025-08-17cli: stream responses in hexai when supported (OpenAI, Ollama)Paul Buetow
- Add llm.Streamer optional interface - Implement ChatStream for OpenAI (SSE) and Ollama (JSON stream) - CLI uses streaming; LSP unchanged (non-streaming) - README: document streaming behavior for CLI
2025-08-17docs(cli): document hexai CLI usage and behaviorsPaul Buetow
- Inputs from stdin/arg, concatenation rules - Stderr styling, immediate provider/model, final stats line - Default concise style; 'explain' keyword for verbose answers - Examples and exit codes
2025-08-17cli: add leading newline before stats on stderr for hexai outputPaul Buetow
2025-08-17cli: add hexai command-line tool and split LSP to hexai-lspPaul Buetow
- New cmd/hexai CLI: reads stdin/arg, prints LLM output to stdout - Prints provider/model immediately to stderr; summary at end - Refactor config loader to internal/appconfig - Update Taskfile to build/install/run both binaries - Update README with new CLI and LSP names
2025-08-17rename CLI binary to hexai-lspPaul Buetow
- Default log path: /tmp/hexai-lsp.log - Taskfile: build/copy/run hexai-lsp binary