diff --git a/CHANGELOG.md b/CHANGELOG.md index ce55ec3..7487949 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ All notable changes to this project will be documented in this file. +## [0.5.3](https://github.com/inference-gateway/docs/compare/0.5.2...0.5.3) (2025-08-28) + +### 🐛 Bug Fixes + +* Update caniuse-lite version in package-lock.json ([d21784a](https://github.com/inference-gateway/docs/commit/d21784a4b97176656f61c0551afd6e41af720526)) +* Update CLI configuration for improved client settings and tool security ([61792d0](https://github.com/inference-gateway/docs/commit/61792d0f9929c800a5a0e081448f07394ad7c874)) +* Update ESLint configuration and scripts for consistency ([9237e9e](https://github.com/inference-gateway/docs/commit/9237e9e26b7e83d4f80ad1883789fa46316dacb1)) + +### 📚 Documentation + +* Add TUI interface image and introduce git shortcuts for AI-generated commit messages ([cd6d65c](https://github.com/inference-gateway/docs/commit/cd6d65c238866d4af51fcf6f38d161d846db8644)) + ## [0.5.2](https://github.com/inference-gateway/docs/compare/0.5.1...0.5.2) (2025-08-28) ### 🐛 Bug Fixes diff --git a/eslint.config.mjs b/eslint.config.mjs index 7ad11ff..3c6811c 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -10,6 +10,9 @@ const compat = new FlatCompat({ }); const eslintConfig = [ + { + ignores: ['node_modules/**', '.next/**', 'out/**', 'build/**', 'next-env.d.ts'], + }, ...compat.extends('next/core-web-vitals', 'next/typescript'), ...compat.extends('prettier'), ]; diff --git a/markdown/cli.mdx b/markdown/cli.mdx index 48942a1..261d8b6 100644 --- a/markdown/cli.mdx +++ b/markdown/cli.mdx @@ -45,6 +45,8 @@ go build -o infer ## Quick Start +![Inference Gateway TUI Interface](/images/tui.gif) + Initialize your project and start using the CLI: ```bash @@ -161,51 +163,137 @@ The CLI uses a 2-layer configuration system with precedence: The CLI creates a comprehensive YAML configuration: ```yaml -# Gateway connection gateway: - url: 'http://localhost:3000' - api_key: 'your-api-key' - timeout: 30s - -# Agent behavior -agent: - model: 'openai/gpt-4' - system_prompt: 'You are a helpful assistant' - max_iterations: 10 - -# Tool execution security + url: http://localhost:8080 + api_key: "" + timeout: 200 +client: + timeout: 200 + retry: + enabled: true + max_attempts: 3 + initial_backoff_sec: 5 + max_backoff_sec: 60 + backoff_multiplier: 2 + retryable_status_codes: [400, 408, 429, 500, 502, 503, 504] +logging: + debug: false tools: - enabled: true - whitelist: - - 'npm*' - - 'git status' - - 'ls -la' - safety: - approval_required: true + enabled: true # Tools are enabled by default with safe read-only commands sandbox: - protected_paths: - - '.git/' - - '*.env' - -# Conversation storage -storage: - backend: 'sqlite' # sqlite, postgresql, redis - path: '.infer/conversations.db' - -# Display preferences -display: - color: true - streaming: true - format: 'markdown' + directories: [".", "/tmp"] # Allowed directories for tool operations + protected_paths: # Paths excluded from tool access for security + - .infer/ + - .git/ + - *.env + bash: + enabled: true + whitelist: + commands: # Exact command matches + - ls + - pwd + - echo + - wc + - sort + - uniq + - gh + - task + patterns: # Regex patterns for more complex commands + - ^git branch( --show-current)?$ + - ^git checkout -b [a-zA-Z0-9/_-]+( [a-zA-Z0-9/_-]+)?$ + - ^git checkout [a-zA-Z0-9/_-]+ + - ^git add [a-zA-Z0-9/_.-]+ + - ^git diff+ + - ^git remote -v$ + - ^git status$ + - ^git log --oneline -n [0-9]+$ + - ^git commit -m ".+"$ + - ^git push( --set-upstream)?( origin)?( [a-zA-Z0-9/_-]+)?$ + read: + enabled: true + require_approval: false + write: + enabled: true + require_approval: true # Write operations require approval by default for security + edit: + enabled: true + require_approval: true # Edit operations require approval by default for security + delete: + enabled: true + require_approval: true # Delete operations require approval by default for security + grep: + enabled: true + backend: auto # "auto", "ripgrep", or "go" + require_approval: false + tree: + enabled: true + require_approval: false + web_fetch: + enabled: true + whitelisted_domains: + - golang.org + safety: + max_size: 4096 # 4KB + timeout: 30 # 30 seconds + allow_redirect: true + cache: + enabled: true + ttl: 3600 # 1 hour + max_size: 52428800 # 50MB + web_search: + enabled: true + default_engine: duckduckgo + max_results: 10 + engines: + - duckduckgo + - google + timeout: 10 + todo_write: + enabled: true + require_approval: false + github: + enabled: true + token: "%GITHUB_TOKEN%" + base_url: "https://api.github.com" + owner: "" + safety: + max_size: 1048576 # 1MB + timeout: 30 # 30 seconds + require_approval: false + safety: + require_approval: true +compact: + output_dir: .infer # Directory for compact command exports + summary_model: "" # Model to use for summarization (optional) +agent: + model: "" # Default model for agent operations + system_prompt: | + System prompt for the main agent + system_reminders: + enabled: true + interval: 4 + reminder_text: | + System reminder text for maintaining context + verbose_tools: false + max_turns: 50 # Maximum number of turns for agent sessions + max_tokens: 4096 # The maximum number of tokens that can be generated per request + optimization: + enabled: false + max_history: 10 + compact_threshold: 20 + truncate_large_outputs: true + skip_redundant_confirmations: true +chat: + theme: tokyo-night ``` ### Environment Variables ```bash export INFER_GATEWAY_URL="http://localhost:3000" -export INFER_API_KEY="your-api-key" -export INFER_MODEL="openai/gpt-4" -export INFER_DEBUG="true" +export INFER_GATEWAY_API_KEY="your-api-key" +export INFER_AGENT_MODEL="openai/gpt-4" +export INFER_LOGGING_DEBUG="true" ``` ## Advanced Features @@ -263,6 +351,41 @@ The TUI provides: - Real-time streaming responses - Model switching during conversation +### Git Shortcuts + +- `/git [args...]` - Execute git commands (supports commit, push, status, etc.) +- `/git commit [flags]` - **NEW**: Commit staged changes with AI-generated message +- `/git push [remote] [branch] [flags]` - **NEW**: Push commits to remote repository + +The git shortcuts provide intelligent commit message generation using AI when no message is provided with `/git commit`. + +## User-Defined Shortcuts + +You can create custom shortcuts by adding YAML configuration files in the `.infer/shortcuts/` directory. + +### Configuration File Format + +Create files named `custom-*.yaml` (e.g., `custom-1.yaml`, `custom-dev.yaml`) in `.infer/shortcuts/`: + +```yaml +shortcuts: + - name: 'tests' + description: 'Run all tests in the project' + command: 'go' + args: ['test', './...'] + working_dir: '.' # Optional: set working directory + + - name: 'build' + description: 'Build the project' + command: 'go' + args: ['build', '-o', 'infer', '.'] + + - name: 'lint' + description: 'Run linter on the codebase' + command: 'golangci-lint' + args: ['run'] +``` + ## Security & Safety ### Command Whitelisting diff --git a/package-lock.json b/package-lock.json index 5cc4cf6..4d039a6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3510,9 +3510,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001702", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001702.tgz", - "integrity": "sha512-LoPe/D7zioC0REI5W73PeR1e1MLCipRGq/VkovJnd6Df+QVqT+vT33OXCp8QUd7kA7RZrHWxb1B36OQKI/0gOA==", + "version": "1.0.30001737", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001737.tgz", + "integrity": "sha512-BiloLiXtQNrY5UyF0+1nSJLXUENuhka2pzy2Fx5pGxqavdrxSCW4U6Pn/PoG3Efspi2frRbHpBV2XsrPE6EDlw==", "funding": [ { "type": "opencollective", diff --git a/package.json b/package.json index ed8a81d..42bd587 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "dev": "next dev", "build": "next build", "start": "next start", - "lint": "next lint", + "lint": "eslint .", "format": "prettier --write .", "format:check": "prettier --check .", "lint:md": "markdownlint \"**/*.md\" \"**/*.mdx\" --ignore \"**/node_modules/**\"", diff --git a/public/images/tui.gif b/public/images/tui.gif new file mode 100644 index 0000000..f0e67b1 Binary files /dev/null and b/public/images/tui.gif differ