by kazupon
Gunshi: JavaScript command-line library, your strategist for CLIs that people and AI agents use
# Add to your Claude Code skills
git clone https://github.com/kazupon/gunshiGuides for using ai agents skills like gunshi.
See how gunshi compares with popular alternatives.
gunshi is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by kazupon. Gunshi: JavaScript command-line library, your strategist for CLIs that people and AI agents use. It has 479 GitHub stars.
gunshi's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/kazupon/gunshi" and add it to your Claude Code skills directory (see the Installation section above).
gunshi is primarily written in TypeScript. It is open-source under kazupon on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh gunshi against similar tools.
No comments yet. Be the first to share your thoughts!
Available after the catalog security scan passes.
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
Gunshi is a JavaScript command-line library, your strategist for CLIs that people and AI agents use.
[!TIP] gunshi (軍師) is a position in ancient Japanese samurai battle in which a samurai devised strategies and gave orders. That name is inspired by the word "command".
Gunshi is designed to simplify the creation of modern command-line interfaces:
# npm
npm install --save gunshi
## pnpm
pnpm add gunshi
## yarn
yarn add gunshi
## bun
bun add gunshi
import { cli } from 'gunshi'
// define a command with declarative configuration, using commandable object
const command = {
name: 'greet',
description: 'A greeting command',
args: {
name: {
type: 'string',
short: 'n',
description: 'Name to greet'
},
greeting: {
type: 'string',
short: 'g',
default: 'Hello',
description: 'Greeting to use (default: "Hello")'
},
times: {
type: 'number',
short: 't',
default: 1,
description: 'Number of times to repeat the greeting (default: 1)'
}
},
run: ctx => {
const { name = 'World', greeting, times } = ctx.values
for (let i = 0; i < times; i++) {
console.log(`${greeting}, ${name}!`)
}
}
}
// run a command that is defined above
// (the 3rd argument of `cli` is the command option)
await cli(process.argv.slice(2), command, {
name: 'my-app',
version: '1.0.0',
description: 'My CLI application'
})
Sub-commands are given with subCommands, keyed by their names:
import { cli, define } from 'gunshi'
const add = define({
name: 'add',
description: 'Add an item',
args: {
title: { type: 'positional', description: 'The title of the item' }
},
run: ctx => console.log(`Added: ${ctx.values.title}`)
})
const list = define({
name: 'list',
description: 'List the items',
run: () => console.log('No items')
})
const main = define({
name: 'todo',
description: 'Manage the items'
})
// `todo add milk`, `todo list` and `todo --help`
await cli(process.argv.slice(2), main, {
version: '1.0.0',
subCommands: { add, list }
})
subCommands can also be an array of commands ([add, list]), and can also be given on the main command (define({ name: 'todo', subCommands: { add, list } })).
About more details and usage, see documentations
If you are interested in contributing to gunshi, I highly recommend checking out the contributing guidelines here. You'll find all the relevant information such as how to make a PR, how to setup development) etc., there.
This project is inspired and powered by:
citty, created by UnJS team and contributorsordana, createdy by sapphi-red, inspired documentation generationThank you!
The development of Gunshi is supported by my OSS sponsors!