graphwork-cli
v2.0.1
Published
Command Line Interface for GraphWork Framework 2.0
Maintainers
Readme
CLI
Command Line Interface for GraphWork Framework 2.0
Overview
The CLI module provides a powerful command-line interface for the GraphWork Framework. It enables developers to initialize projects, generate code, validate quality, and analyze architecture directly from the terminal.
Installation
# Global installation
npm install -g graphwork-cli
# Local installation
npm install graphwork-cliFeatures
- Project Initialization: Create new GraphWork projects with predefined templates
- Code Generation: Generate components, services, controllers, and more with AI assistance
- Quality Validation: Validate code quality, security, and compliance
- Architecture Analysis: Analyze project architecture against specifications
- Progressive Assistance: Adaptive help based on user experience level
- Interactive Prompts: User-friendly interactive command-line interface
Usage
Initialize a New Project
# Interactive initialization
gw init
# Direct initialization with options
gw init my-project --template fullstack --tech react,nodejs,postgresql --domain ecommerceGenerate Code
# Generate a controller
gw generate controller --name user --context work/03-architecture/system_design.md
# Generate a service
gw generate service --name user-service --context work/02-specs/functional_spec.md
# Generate a component
gw generate component --name user-profile --context work/02-specs/ui_specs.mdValidate Quality
# Validate all aspects of the project
gw validate --all
# Validate specific aspects
gw validate --security
gw validate --performance
gw validate --qualityAnalyze Architecture
# Analyze architecture
gw analyze --architecture
# Analyze dependencies
gw analyze --dependenciesOther Commands
# Show system status
gw status
# Show help
gw --help
# Show version
gw --versionCommands
init
Initialize a new GraphWork project.
gw init [name] [options]Options:
--template <template>: Project template to use--tech <technologies>: Comma-separated list of technologies--domain <domain>: Project domain
generate
Generate code components with AI assistance.
gw generate <type> [options]Types:
controller: Generate a controllerservice: Generate a servicecomponent: Generate a UI componentmodel: Generate a data modeltemplate: Generate a custom template
Common Options:
--name <name>: Name of the component to generate--context <file>: Context file to use for generation--template <file>: Custom template to use
validate
Validate project quality, security, and compliance.
gw validate [options]Options:
--all: Validate all aspects--security: Validate security aspects--performance: Validate performance aspects--quality: Validate code quality--file <file>: Validate specific file
analyze
Analyze project architecture and dependencies.
gw analyze [options]Options:
--architecture: Analyze architecture--dependencies: Analyze dependencies--complexity: Analyze code complexity
status
Show the current status of the GraphWork system.
gw statusConfiguration
The CLI can be configured through a graphwork.config.js file in your project root:
module.exports = {
ai: {
provider: 'openai', // or 'anthropic', 'gemini'
model: 'gpt-4',
temperature: 0.3,
apiKey: process.env.GRAPHWORK_AI_API_KEY
},
security: {
dataProtection: true,
inputValidation: true
},
quality: {
codeStandards: 'strict',
testCoverage: 80
}
};Environment Variables
GRAPHWORK_AI_API_KEY: API key for the AI provider (OpenAI, Anthropic, or Google Gemini)GRAPHWORK_DEBUG: Enable debug loggingGRAPHWORK_TEMPLATE_DIR: Custom template directory
Contributing
See our Contributing Guide for information on how to contribute to this package.
License
This package is licensed under the MIT License. See the LICENSE file for details.
