{"id":29067389,"url":"https://github.com/blysin/autocmdr","last_synced_at":"2026-05-05T09:31:49.865Z","repository":{"id":300865935,"uuid":"1007031904","full_name":"blysin/autocmdr","owner":"blysin","description":"一个使用 Go 和 LangChain 构建的命令行辅助应用，旨在帮助用户安全地与 AI 模型交互以生成和执行系统命令。","archived":false,"fork":false,"pushed_at":"2025-06-24T02:09:38.000Z","size":70,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-19T19:40:45.613Z","etag":null,"topics":["langchain","powershell","shell"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blysin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-23T11:06:46.000Z","updated_at":"2025-06-24T02:09:41.000Z","dependencies_parsed_at":"2025-06-24T02:25:57.503Z","dependency_job_id":"72d30aab-8182-4af8-a121-b3d1a3016d87","html_url":"https://github.com/blysin/autocmdr","commit_stats":null,"previous_names":["blysin/autocmdr"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/blysin/autocmdr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blysin%2Fautocmdr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blysin%2Fautocmdr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blysin%2Fautocmdr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blysin%2Fautocmdr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blysin","download_url":"https://codeload.github.com/blysin/autocmdr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blysin%2Fautocmdr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32643539,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"online","status_checked_at":"2026-05-05T02:00:06.033Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["langchain","powershell","shell"],"created_at":"2025-06-27T11:00:54.917Z","updated_at":"2026-05-05T09:31:49.854Z","avatar_url":"https://github.com/blysin.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AutoCmdr App\n\n[![Go Version](https://img.shields.io/badge/Go-1.21+-blue.svg)](https://golang.org)\n[![License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)\n[![Go Report Card](https://goreportcard.com/badge/github.com/blysin/autocmdr)](https://goreportcard.com/report/github.com/blysin/autocmdr)\n[![CI](https://github.com/blysin/autocmdr/workflows/CI/badge.svg)](https://github.com/blysin/autocmdr/actions)\n\n[English](README.md) | [简体中文](README_zh.md)\n\nA command-line assistant application built using Go and LangChain, designed to help users securely interact with AI models to generate and execute system commands.\n\n## 🚀 Features\n\n- **Cross-Platform Support**: Works on Windows (PowerShell), Linux, and macOS (Bash)\n- **Interactive CLI**: Rich command-line interface with readline support\n- **Smart Command Generation**: AI-powered command generation with safety checks\n- **Configuration Management**: Flexible configuration with file and environment variable support\n- **Structured Logging**: Comprehensive logging with configurable levels\n- **Memory Management**: Conversation history with configurable window size\n- **Safety First**: Built-in safety checks and confirmation prompts\n- **Extensible Architecture**: Modular design following Go best practices\n\n## 📦 Installation\n\n### From Source\n\n```bash\n# Clone the repository\ngit clone https://github.com/blysin/autocmdr.git\ncd autocmdr-app\n\n# Build and install\nmake install\n```\n\n### Using Go Install\n\n```bash\ngo install github.com/blysin/autocmdr/cmd/autocmdr@latest\n```\n\n### Pre-built Binaries\n\nDownload the latest release from the [releases page](https://github.com/blysin/autocmdr/releases).\n\n## 🔧 Configuration\n\n### Initialize Configuration\n\n```bash\nautocmdr -init -m \"your-model\" -u \"http://your-ollama-server:11434\"\n```\n\n### Configuration Options\n\nThe application supports configuration through:\n\n1. **Configuration File**: `~/.autocmdr/config.json`\n2. **Environment Variables**: Prefixed with `LANGCHAIN_CHAT_`\n3. **Command Line Flags**\n\n#### Configuration Parameters\n\n| Parameter | Environment Variable | Default | Description |\n|-----------|---------------------|---------|-------------|\n| `model` | `LANGCHAIN_CHAT_MODEL` | `qwen3:14b` | AI model name |\n| `server_url` | `LANGCHAIN_CHAT_SERVER_URL` | `http://localhost:11434` | Ollama server URL |\n| `token` | `LANGCHAIN_CHAT_TOKEN` | `\"\"` | API authentication token |\n| `log_level` | `LANGCHAIN_CHAT_LOG_LEVEL` | `info` | Log level (debug, info, warn, error) |\n\n### Example Configuration File\n\n```json\n{\n  \"model\": \"qwen3:14b\",\n  \"server_url\": \"http://localhost:11434\",\n  \"token\": \"\",\n  \"log_level\": \"info\"\n}\n```\n\n## 🎯 Usage\n\n### Basic Usage\n\n```bash\n# Start interactive chat\nautocmdr\n\n# View current configuration\nautocmdr -view\n\n# View system prompt\nautocmdr -prompt\n\n# Show version information\nautocmdr -version\n```\n\n### Interactive Commands\n\nOnce in the chat session:\n\n- Type your request in natural language\n- The AI will generate appropriate commands\n- Confirm execution with `y` or `n`\n- Use `clear` to clear conversation history\n- Use `exit` to quit the application\n\n### Example Session\n\n```\nYou: list all files in the current directory\nBot: I'll help you list all files in the current directory.\n\n{\n  \"success\": \"true\",\n  \"multipleLines\": \"false\",\n  \"script\": \"Get-ChildItem -Force\"\n}\n\nExecute script directly? (y/n)\nYou: y\n✅ Script executed successfully (exit code: 0)\nOutput:\nDirectory: C:\\Users\\example\n\nMode                 LastWriteTime         Length Name\n----                 -------------         ------ ----\nd-----         2023/12/01     10:30                Documents\nd-----         2023/12/01     10:30                Downloads\n...\n```\n\n## 🏗️ Development\n\n### Prerequisites\n\n- Go 1.21 or later\n- Make (optional, for using Makefile)\n\n### Building from Source\n\n```bash\n# Clone the repository\ngit clone https://github.com/blysin/autocmdr.git\ncd autocmdr-app\n\n# Install dependencies\nmake deps\n\n# Run tests\nmake test\n\n# Build the application\nmake build\n\n# Run the application\nmake run\n```\n\n### Project Structure\n\n```\nautocmdr-app/\n├── cmd/\n│   └── autocmdr/        # Application entry point\n├── pkg/\n│   ├── config/               # Configuration management\n│   ├── chat/                 # Chat functionality\n│   ├── prompts/              # Prompt templates and loading\n│   └── utils/                # Utility functions\n├── internal/\n│   └── version/              # Version information\n├── examples/                 # Usage examples\n├── docs/                     # Documentation\n├── scripts/                  # Build and utility scripts\n└── .github/                  # GitHub workflows and templates\n```\n\n### Available Make Targets\n\n```bash\nmake help                     # Show all available targets\nmake build                    # Build the application\nmake test                     # Run tests\nmake test-coverage           # Run tests with coverage\nmake lint                    # Run linters\nmake fmt                     # Format code\nmake clean                   # Clean build artifacts\n```\n\n## 🧪 Testing\n\n```bash\n# Run all tests\nmake test\n\n# Run tests with coverage\nmake test-coverage\n\n# Run benchmarks\nmake bench\n```\n\n## 📚 Documentation\n\n- [API Documentation](docs/api.md)\n- [Configuration Guide](docs/configuration.md)\n- [Contributing Guide](CONTRIBUTING.md)\n\n## 🤝 Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n### Development Workflow\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests for new functionality\n5. Run the test suite\n6. Submit a pull request\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgments\n\n- [LangChain Go](https://github.com/tmc/langchaingo) - Go implementation of LangChain\n- [Ollama](https://ollama.ai/) - Local AI model serving\n- [Cobra](https://github.com/spf13/cobra) - CLI framework\n- [Viper](https://github.com/spf13/viper) - Configuration management\n\n## 📞 Support\n\n- 📧 Email: blysin@163.com\n- 🐛 Issues: [GitHub Issues](https://github.com/blysin/autocmdr/issues)\n- 💬 Discussions: [GitHub Discussions](https://github.com/blysin/autocmdr/discussions)\n\n---\n\nMade with ❤️ by the AutoCmdr App team\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblysin%2Fautocmdr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblysin%2Fautocmdr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblysin%2Fautocmdr/lists"}