Catalog npm
Back to packageRELEASE DETAILS

0.0.8

npm

1shot

1shot CLI

aiassistantclaudecodeoneshottemplate
Published20 Aug 2025
Direct dependencies25
Transitive dependenciesNot calculated

README

Current package documentation

1shot

A powerful AI-powered CLI tool that executes predefined commands with a single shot. Built on top of assistant-code, 1shot provides a collection of ready-to-use AI assistants for common development tasks.

Features

  • 🎯 One-command execution: Run complex tasks with a single command
  • 🤖 Pre-configured AI assistants: Various specialized assistants for different tasks
  • 📋 Interactive command selector: Browse and select commands interactively
  • 🔄 Git-aware: Warns about uncommitted changes before execution
  • ⏸️ Pause functionality: Press ESC to pause execution during tasks
  • 🎨 Beautiful CLI interface: Built with Ink and React
  • 📊 Task completion summary: Shows execution details and stats after completion

Installation

npm install -g 1shot

Setup

You need an Anthropic API key to use 1shot:

export ANTHROPIC_API_KEY=your-api-key
# or
export ASSISTANT_CODE_API_KEY=your-api-key

Get your API key from: https://claude.ai/settings/keys

Usage

Basic Usage

# Run a specific command
1shot <command-name>

# Run a command with custom prompt
1shot <command-name> "your custom request"

# Interactive command selector
1shot commands

Available Commands

  • assistant-ui - Integrate assistant-ui into your project 🤖
  • bug - Find and fix bugs in your project 🐛
  • fix-next-build - Fix Next.js build issues 🔧
  • frenchify - Translate project summary to French 🇫🇷
  • hello-world - Simple greeting command 👋
  • prd - Create a comprehensive Product Requirements Document 📋
  • readme - Create a README.md file for your project 📄
  • upgrade-next - Upgrade to latest Next.js ⚡
  • upgrade-react - Upgrade to latest React ⚛️
  • upgrade-typescript - Upgrade to latest TypeScript 💙

Examples

# Create a README for your project
1shot readme

# Find and fix bugs in your codebase
1shot bug

# Create a comprehensive PRD with best practices
1shot prd

# Use custom prompt with any command
1shot prd "Add user personas and an API section."

# Interactive mode - browse and select commands
1shot commands

Git Integration

1shot checks your git status before executing commands and will warn you if:

  • You're not in a git repository
  • You have uncommitted changes
  • You have untracked files

You can choose to continue anyway or cancel to commit your changes first.

Pause and Resume

During command execution, you can:

  • Press ESC once to see a pause warning
  • Press ESC again within 3 seconds to pause execution
  • Press any key to resume when paused
  • Press Ctrl+C to cancel completely

Development

Project Structure

1shot/
├── src/
│   ├── index.ts        # Main CLI entry point
│   ├── registry.ts     # Command registry
│   └── components/     # React components (if any)
├── dist/               # Compiled output
├── package.json
├── build.mts           # Build configuration
└── README.md

Prerequisites

  • Node.js (with ESM support)
  • npm or yarn
  • TypeScript

Building

# Install dependencies
npm install

# Build the project
npm run build

Development Mode

# Run in watch mode
npm run dev

Adding New Commands

To add a new command, edit src/registry.ts:

export const registry: Record<string, RegistryEntry> = {
  "your-command": {
    systemPrompt: "System prompt for the AI assistant",
    prompt: "🎯 Default user prompt",
  },
  // ... other commands
};

Key points for new commands:

  • Keep command names lowercase with hyphens
  • Start prompts with an emoji for visual clarity
  • System prompts should clearly define the assistant's role
  • Consider using tools like Deepwiki for enhanced capabilities

Dependencies

Core Dependencies

  • @assistant-ui/react - UI components for assistant interfaces
  • assistant-code - Core AI assistant functionality
  • ink - React renderer for CLI apps
  • cross-spawn - Cross-platform command execution
  • vite - Build tool

Development Dependencies

  • TypeScript
  • Vite plugins
  • Tailwind CSS (for any UI components)

Contributing

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

Contribution Guidelines

  • Follow the existing code style
  • Add your new commands in alphabetical order
  • Include clear descriptions for system prompts
  • Test your changes before submitting
  • Update documentation if needed

Troubleshooting

API Key Issues

If you see "No API key found", ensure you've set:

export ANTHROPIC_API_KEY=your-api-key

Command Not Found

If 1shot command is not found after installation:

  1. Ensure npm global bin is in your PATH
  2. Try installing with sudo (on Unix systems)
  3. Use npx 1shot as an alternative

Build Errors

If you encounter build errors:

  1. Ensure you're using a compatible Node.js version
  2. Delete node_modules and reinstall
  3. Check that all TypeScript types are properly installed

License

MIT License - see LICENSE file for details

Acknowledgments

Built with ❤️ using:

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 25

Native requirements
25 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
ink
Environment
{
  "local_name": "ink",
  "alias": false,
  "peer_metadata": null
}
^6.1.0runtime
zod
Environment
{
  "local_name": "zod",
  "alias": false,
  "peer_metadata": null
}
^4.0.15runtime
vite
Environment
{
  "local_name": "vite",
  "alias": false,
  "peer_metadata": null
}
^7.0.6runtime
react
Environment
{
  "local_name": "react",
  "alias": false,
  "peer_metadata": null
}
^19.1.1runtime
fastmcp
Environment
{
  "local_name": "fastmcp",
  "alias": false,
  "peer_metadata": null
}
^3.14.0runtime
zustand
Environment
{
  "local_name": "zustand",
  "alias": false,
  "peer_metadata": null
}
^5.0.7runtime
wrap-ansi
Environment
{
  "local_name": "wrap-ansi",
  "alias": false,
  "peer_metadata": null
}
^9.0.0runtime
cross-spawn
Environment
{
  "local_name": "cross-spawn",
  "alias": false,
  "peer_metadata": null
}
^7.0.6runtime
ink-select-input
Environment
{
  "local_name": "ink-select-input",
  "alias": false,
  "peer_metadata": null
}
^6.2.0runtime
@assistant-ui/tap
Environment
{
  "local_name": "@assistant-ui/tap",
  "alias": false,
  "peer_metadata": null
}
^0.0.2runtime
@assistant-ui/react-core
Environment
{
  "local_name": "@assistant-ui/react-core",
  "alias": false,
  "peer_metadata": null
}
^0.0.4runtime
@anthropic-ai/claude-code
Environment
{
  "local_name": "@anthropic-ai/claude-code",
  "alias": false,
  "peer_metadata": null
}
^1.0.70runtime
tsx
Environment
{
  "local_name": "tsx",
  "alias": false,
  "peer_metadata": null
}
^4.20.3development
postcss
Environment
{
  "local_name": "postcss",
  "alias": false,
  "peer_metadata": null
}
^8.5.6development
vite-node
Environment
{
  "local_name": "vite-node",
  "alias": false,
  "peer_metadata": null
}
^3.2.4development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^5.9.2development
@types/node
Environment
{
  "local_name": "@types/node",
  "alias": false,
  "peer_metadata": null
}
^24.2.0development
tailwindcss
Environment
{
  "local_name": "tailwindcss",
  "alias": false,
  "peer_metadata": null
}
^4.1.11development
@types/react
Environment
{
  "local_name": "@types/react",
  "alias": false,
  "peer_metadata": null
}
^19.1.9development
autoprefixer
Environment
{
  "local_name": "autoprefixer",
  "alias": false,
  "peer_metadata": null
}
^10.4.21development
@anthropic-ai/sdk
Environment
{
  "local_name": "@anthropic-ai/sdk",
  "alias": false,
  "peer_metadata": null
}
^0.58.0development
@types/cross-spawn
Environment
{
  "local_name": "@types/cross-spawn",
  "alias": false,
  "peer_metadata": null
}
^6.0.6development
vite-tsconfig-paths
Environment
{
  "local_name": "vite-tsconfig-paths",
  "alias": false,
  "peer_metadata": null
}
^5.1.4development
@vitejs/plugin-react
Environment
{
  "local_name": "@vitejs/plugin-react",
  "alias": false,
  "peer_metadata": null
}
^4.7.0development
@assistant-ui/x-buildutils
Environment
{
  "local_name": "@assistant-ui/x-buildutils",
  "alias": false,
  "peer_metadata": null
}
0.0.1development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "8d2b8445bb9591b751a0550e3a8e8d46b88f5e4c",
  "tarball": "https://registry.npmjs.org/1shot/-/1shot-0.0.8.tgz",
  "fileCount": 147,
  "integrity": "sha512-O1pm9VcEZOOLYGnfblIosauieujB80+mYAuYg2xLdzi/N1Il4Vgm4mtXWBpff1qqZMwrUDDJzO8XhF3JNTq2Ww==",
  "signatures": [
    {
      "sig": "MEUCIQCrU+LIjqiFogZ+zs4JitsG0xbVZFTDpEe8Ehozj5EpWQIgfFR/moJbQOsomknNheSrZKg0py9Ks3LfJlVmRgz6Y5Y=",
      "keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"
    }
  ],
  "unpackedSize": 426546
}

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 18:37 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:8df7c24b962c62d207930265ff631eefc328e6c9fcaaf54ea8fad063213a34ce

Other collected versions

0.0.920 Aug0.0.720 Aug0.0.619 Aug0.0.519 Aug0.0.419 Aug0.0.36 AugView all collected versions →