A CLI tool for code guidance with programmatic API
npm install codeguideA comprehensive toolkit for AI-powered code guidance and project management. Includes both a CLI tool and a programmatic API for seamless integration into your development workflow.
A powerful CLI tool for code guidance with full project management capabilities.
Features:
- Project creation and initialization
- Task management and tracking
- API key management
- Usage analytics and monitoring
- Repository analysis
- Interactive command-line interface
Installation:
``bash`
npm install -g @codeguide/cli
The core package with TypeScript interfaces and services for integrating CodeGuide into your applications.
Features:
- Full TypeScript support with IntelliSense
- API key management (CRUD operations)
- Project management services
- Task management APIs
- Usage analytics
- Multiple authentication methods
Installation:
`bash`
npm install @codeguide/core
`bashInstall CLI
npm install -g @codeguide/cli
$3
`typescript
// Install core package
npm install @codeguide/coreimport { CodeGuide } from '@codeguide/core'
const codeguide = new CodeGuide({
baseUrl: 'https://api.codeguide.ai',
databaseApiKey: 'sk_your_key'
})
// Create API key
const newKey = await codeguide.apiKeyEnhanced.createApiKey({
name: 'My Application'
})
`Documentation
| Package | Description | Link |
|---------|-------------|------|
| CLI | Command-line interface with full documentation | README |
| Core | Programmatic API with TypeScript support | README |
Commands
$3
`bash
Start a new project
codeguide start [prompt] [options]Initialize current directory
codeguide initGenerate documentation
codeguide generate [options]
`$3
`bash
List tasks
codeguide task list [options]Start a task
codeguide task update --status in_progressUpdate a task
codeguide task update [options]
`$3
`bash
Interactive login
codeguide loginLogin with API key
codeguide login --api-key your-api-keyCheck health
codeguide healthCheck authentication status
codeguide auth status
`$3
`bash
Check credit balance
codeguide usage balanceView usage summary
codeguide usage summaryCheck authorization status
codeguide usage auth
`CLI Options
$3
`bash
codeguide start [prompt] [options]Options:
-l, --language Programming language
-c, --context Additional context
-v, --verbose Verbose output
-o, --output Output file (default: README.md)
--api-url API URL
--api-key API key
--current-codebase Generate in current directory
-h, --help Display help
`$3
`bash
codeguide task list [options]Options:
--status Filter by status (pending, in_progress, completed)
--page Page number
--page-size Page size
codeguide task update [options]
Options:
--status Update status
--ai-result AI completion result
--title Update title
--description Update description
`Project Structure
When you create a new project with
codeguide start, it generates:`
my-project/
āāā codeguide.json # Project configuration
āāā AGENTS.md # AI agent guidelines
āāā instructions.md # Getting started guide
āāā documentation/ # Generated documentation
āāā project-outline.md
āāā technical-specs.md
āāā implementation-plan.md
`Configuration
$3
-
CODEGUIDE_API_URL: API base URL (default: https://api.codeguide.dev)
- CODEGUIDE_API_KEY: API key for authentication$3
The CLI supports multiple authentication methods:
1. Database API Key (highest priority):
sk_... format
2. Legacy API Key (medium priority): Traditional API keys
3. Clerk JWT Token (lowest priority): JWT tokensAuthentication configuration is automatically saved locally for convenience.
$3
The CLI now supports interactive authentication setup:
`bash
Interactive login with API key creation
codeguide loginDirect API key authentication
codeguide login --api-key your-api-key
`Development
$3
`bash
Clone repository
git clone https://github.com/CodeGuide-dev/codeguide.git
cd codeguideInstall dependencies
npm installBuild all packages
npm run buildLink for local development
npm run dev:link
`$3
`bash
Build all packages
npm run buildBuild specific package
npm run build:core
npm run build:cliRun CLI in development mode
npm run devRun tests
npm run testRun tests with coverage
npm run test:coverageLint code
npm run lintType checking
npm run typecheckFormat code
npm run format
`$3
`
codeguide/
āāā packages/
ā āāā core/ # Core package (@codeguide/core)
ā ā āāā dist/ # Built JavaScript files
ā ā āāā services/ # API services
ā ā āāā types.ts # TypeScript types
ā ā āāā api-service.ts # Main API service
ā āāā cli/ # CLI package (@codeguide/cli)
ā āāā dist/ # Built JavaScript files
ā āāā commands.ts # CLI commands
ā āāā utils/ # Utility functions
ā āāā index.ts # CLI entry point
āāā package.json # Root workspace configuration
āāā README.md # This file
`API Usage
$3
`typescript
import { CodeGuide } from '@codeguide/core'const codeguide = new CodeGuide(
{
baseUrl: 'https://api.codeguide.dev',
databaseApiKey: 'your-api-key',
},
{
language: 'typescript',
verbose: true,
}
)
// Check health
const isHealthy = await codeguide.isHealthy()
// Generate project title
const title = await codeguide.generation.generateTitle({
description: 'A React app with TypeScript',
})
// Generate project outline
const outline = await codeguide.generation.generateOutline({
project_type: 'react',
description: 'A React app with TypeScript',
title: title.title,
})
`$3
The core package provides access to all API services:
- Generation Service: Generate titles, outlines, and documents
- Projects Service: Create and manage projects
- Tasks Service: Task management and tracking
- Usage Service: Usage tracking and credit management
- Repository Service: Code analysis and insights
Examples
$3
`bash
codeguide start "Create a React app with TypeScript, Tailwind CSS, and routing" --language react
`$3
`bash
cd existing-project
codeguide init
codeguide generate --current-codebase
`$3
`bash
codeguide usage balance
codeguide usage summary --start-date 2024-01-01 --end-date 2024-12-31
`Troubleshooting
$3
1. Authentication Failed
`bash
# Check your API key
codeguide login --api-key your-api-key # Verify API health
codeguide health
`2. Permission Denied
- Ensure your API key has sufficient permissions
- Check your subscription status
3. Build Errors
`bash
# Clean build
npm run build # Check types
npm run typecheck
`$3
- Documentation: GitHub Wiki
- Issues: GitHub Issues
- API Documentation: API Docs
Contributing
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests if applicable
5. Run
npm run dev:prepare` to lint and typecheckMIT License - see LICENSE file for details.
- Bump version to 0.0.11
- Add --api-key flag to login command for non-interactive authentication
- Add interactive docs setup command with API key creation links
- Fix TypeScript error in cancellation funnel service
- Enhanced task management system
- Added codespace service for development environments
- Improved error handling and type safety
- Initial release
- Project creation with AI-generated documentation
- Task management system
- Authentication and usage tracking
- CLI and programmatic API interfaces