Skip to content

dtannen/claude-stacks

Repository files navigation

Claude Stacks

Coverage npm version License: MIT

Share your Claude Code environment in seconds - export and import development stacks.

What is Claude Stacks?

Claude Stacks is a CLI tool that allows you to:

  • Export your Claude Code environment configurations as portable stack files
  • Share development stacks with your team or the community via Commands.com
  • Import environments quickly across different projects and machines
  • Browse and install stacks from the Commands.com marketplace

Perfect for sharing MCP server configurations, project setups, and development environments with Claude Code users.

Installation

Install globally via npm:

npm install -g claude-stacks

Or use npx to run without installing:

npx claude-stacks --help

Quick Start

Export Your Current Setup

claude-stacks export

List Your Stacks

claude-stacks list

Export with Custom Metadata

claude-stacks export --name "My Dev Stack" --description "Full-stack development environment"

Import from a Stack

claude-stacks import my-stack.json

Share via Commands.com

# Publish to the marketplace
claude-stacks publish my-stack.json

# Browse available stacks
claude-stacks browse

# Install from marketplace
claude-stacks install org-name/stack-name

Commands

Core Commands

  • export [filename] - Export current environment to a stack file
  • import <filename> - Import environment from a stack file
  • publish <filename> - Publish stack to Commands.com marketplace
  • install <stack-id> - Install stack from Commands.com
  • browse - Browse marketplace stacks interactively

Management Commands

  • list - List local stacks
  • scan-hooks - Scan hooks for potential security issues
  • delete <stack-id> - Delete published stack from Commands.com
  • rename <stack-id> - Rename published stack
  • clean - Clean up local stack metadata

Export Options

  • --name <name> - Custom stack name
  • --description <description> - Stack description
  • --stack-version <version> - Set version (default: auto-increment)
  • --include-global - Include global ~/.claude configurations
  • --include-claude-md - Include CLAUDE.md files

Import Options

  • --overwrite - Overwrite existing files (default: merge)
  • --global-only - Only import to global ~/.claude

What Gets Exported?

Claude Stacks captures your Claude Code environment including:

  • MCP Server Configurations - All configured MCP servers and their settings
  • Project Commands - Custom commands defined for your project
  • Agent Configurations - Custom agents and their configurations
  • Hook Scripts - User hook scripts with security analysis
  • Project Settings - Claude Code project-specific settings
  • CLAUDE.md Files - Project instructions (when --include-claude-md is used)
  • Global Configurations - User-level settings (when --include-global is used)

Hook Safety

Claude Stacks automatically analyzes hook scripts for potential security risks during export:

# Scan hooks independently
claude-stacks scan-hooks

# Security analysis is included during export
claude-stacks export my-stack.json

Risk Levels:

  • 🔴 High - Dangerous operations (command execution, file deletion)
  • 🟡 Medium - Potentially risky operations (network requests, file writes)
  • 🟢 Low - Minor concerns (environment variable access)

Supports Python, JavaScript, TypeScript, and Bash hook analysis.

⚠️ Important: Hook analysis provides guidance only. Users install and execute hooks at their own risk. Always review hook code before use, especially from untrusted sources.

Authentication

To publish or manage stacks on Commands.com, you'll need to authenticate:

claude-stacks publish my-stack.json

The CLI will automatically guide you through the OAuth authentication process on first use.

Stack File Format

Stack files are JSON documents containing:

{
  "name": "My Development Stack",
  "description": "Full-stack development environment with MCP servers",
  "version": "1.0.0",
  "author": "Your Name",
  "mcpServers": [...],
  "commands": [...],
  "agents": [...],
  "settings": {...}
}

Development

Prerequisites

  • Node.js 18+
  • npm or yarn

Setup

# Clone the repository
git clone https://github.com/commands-com/claude-stacks.git
cd claude-stacks

# Install dependencies
npm install

# Build the project
npm run build

# Run tests
npm test

Development Scripts

  • npm run dev - Run in development mode
  • npm run build - Build TypeScript to JavaScript
  • npm run test - Run test suite with coverage
  • npm run lint - Lint code
  • npm run format - Format code with Prettier
  • npm run quality - Run all quality checks

Testing

The project has comprehensive test coverage (90%+):

# Run all tests
npm test

# Run specific test types
npm run test:unit
npm run test:integration
npm run test:e2e

# Watch mode during development
npm run test:watch

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run quality checks (npm run quality)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Security

This tool handles your Claude Code configurations and requires network access to Commands.com. All data transmission is encrypted and the tool follows security best practices:

  • OAuth 2.0 PKCE for secure authentication
  • HTTPS-only API communication
  • Local credential storage with appropriate permissions
  • Input validation and sanitization
  • Automated security analysis of hook scripts

License

MIT License - see LICENSE file for details.

Support


Made with ❤️ for the Claude Code community

About

Import/Export your Claude mcps/agents/commands/hooks/settings in seconds

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors