Modern, extensible JIRA command-line interface built with Factory pattern and Commander.js. Provides full CRUD operations for issues, projects, and sprints with beautiful terminal UX.
- Non-Interactive: All commands require explicit CLI arguments for full automation support
- Scriptable: Designed for CI/CD pipelines and shell scripts
- No Prompts: All input via flags or environment variables, no interactive prompts
- Description Files: Use
--description-filefor multi-line content - Explicit Validation: Clear error messages with usage examples when options missing
- Factory Pattern: Command creation via
lib/factory.js - Dependency Injection: Services injected into commands
- Commander.js: CLI framework for command routing and parsing
jira-cli/
├── bin/
│ ├── index.js # CLI entry point
│ ├── root.js # Root command setup
│ └── commands/ # Command implementations
│ ├── config.js # Configuration management
│ ├── issue.js # Issue CRUD operations
│ ├── project.js # Project operations
│ └── sprint.js # Sprint management
├── lib/
│ ├── jira-client.js # JIRA API client (axios)
│ ├── config.js # Config management (conf package)
│ ├── factory.js # Command factory
│ ├── iostreams.js # I/O abstractions for testing
│ ├── utils.js # Utility functions
│ └── analytics.js # Usage analytics
└── tests/ # Jest unit tests
- commander: CLI framework
- axios: HTTP client for JIRA API
- chalk: Terminal colors
- ora: Spinners and progress indicators
- cli-table3: Formatted table output
- conf: Cross-platform config storage
- JavaScript (CommonJS), not TypeScript
- Self-documenting code preferred over comments (per global CLAUDE.md)
- Use descriptive variable/function names
- Follow existing patterns in the codebase
- Create command file in
bin/commands/ - Implement command logic following existing patterns
- Register command in
bin/root.js - Add tests in
tests/commands/ - Update README.md with command documentation
- Use
lib/jira-client.jsfor all JIRA API calls - Handle authentication via config (API token + username)
- Implement proper error handling with user-friendly messages
- Use iostreams for output (supports testing and mocking)
- Config stored via
confpackage (platform-specific locations) - Support environment variables and CLI flags (no interactive setup)
- Environment variables:
JIRA_HOST,JIRA_API_TOKEN,JIRA_USERNAME - Legacy support:
JIRA_DOMAIN,JIRA_USERNAME,JIRA_API_TOKEN - CLI flags:
jira config --server <url> --username <email> --token <token>
- Create: Require
--project,--type,--summaryflags - Update: Require at least one field flag
- Delete: Require
--forceflag (no confirmation prompt) - Description Files: Support
--description-file <path>for multi-line content
npm test # Run all tests
npm run test:watch # Watch mode
npm run test:coverage # Coverage report- Unit tests for all commands and lib functions
- Mock JIRA API calls using Jest mocks
- Use iostreams abstraction for CLI I/O testing
- Maintain high test coverage
- Place tests in
tests/directory mirroring source structure - Use descriptive test names
- Mock external dependencies (axios)
- Test both success and error cases
All commits must follow Conventional Commits format:
feat:- New features (minor version bump)fix:- Bug fixes (patch version bump)docs:- Documentation onlyrefactor:- Code refactoringtest:- Test additions/changeschore:- Build/tooling changes
- Merge to
maintriggers semantic-release - Version bumped automatically based on commit types
- Changelog generated from commit messages
- NPM publish automated via GitHub Actions
See AGENTS.md for emergency release procedures if automation fails.
- Add method to
lib/jira-client.js - Use axios for HTTP requests
- Handle authentication headers automatically
- Return meaningful error messages
- Add unit tests with mocked responses
- Use
chalkfor colored output - Use
orafor loading indicators - Use
cli-table3for tabular data - Provide clear error messages with actionable guidance
- Show usage examples in error messages when required options missing
DEBUG=jira-cli* jira issue --list
JIRA_CLI_ANALYTICS=false jira config --show- JIRA API uses Bearer token authentication (API tokens, not passwords)
- Support both JIRA Cloud and JIRA Data Center APIs
- Handle rate limiting and network errors gracefully
- Respect user privacy (analytics opt-out via
JIRA_CLI_ANALYTICS=false) - Always test with real JIRA instance before releasing