quickey
v0.2.0
Published
Your usual shell commands at your fingertips.
Downloads
6
Readme
Quickey
Installation
npm install -g quickeyQuick Start
- Initialize a configuration file in your project:
quickey --init- Or use with your existing package.json (npm scripts will be automatically loaded):
cd your-project
quickeyConfiguration
Quickey supports multiple configuration formats:
JavaScript (.quickey.js)
export default function(q) {
// Simple action
q.action('hello')
.description('Say hello')
.shell('echo "Hello, World!"')
// Action with user prompt
q.action('greet')
.description('Greet someone')
.prompt('Enter a name')
.shell('echo "Hello, {{input}}!"')
// Action with named prompts
q.action('deploy')
.description('Deploy application')
.prompt('env', 'Environment (dev/prod)')
.prompt('version', 'Version number')
.shell('deploy --env {{env}} --version {{version}}')
// Category with nested actions
q.category('dev')
.description('Development commands')
.content(q => {
q.action('test').shell('npm test')
q.action('build').shell('npm run build')
})
}JSON (.quickey.json)
[
{
"label": "hello",
"description": "Say hello",
"shell": "echo \"Hello, World!\""
},
{
"label": "greet",
"description": "Greet someone",
"prompt": "Enter a name",
"shell": "echo \"Hello, {{input}}!\""
},
{
"label": "deploy",
"description": "Deploy application",
"prompts": [
{ "name": "env", "message": "Environment (dev/prod)" },
{ "name": "version", "message": "Version number" }
],
"shell": "deploy --env {{env}} --version {{version}}"
}
]YAML (.quickey.yaml or .quickey.yml)
- label: hello
description: Say hello
shell: echo "Hello, World!"
- label: greet
description: Greet someone
prompt: "Enter a name"
shell: "echo \"Hello, {{input}}!\""
- label: deploy
description: Deploy application
prompts:
- name: env
message: "Environment (dev/prod)"
- name: version
message: "Version number"
shell: "deploy --env {{env}} --version {{version}}"User Prompts
Quickey supports prompting users for input before executing commands. Use placeholders like {{name}} in your shell commands to inject user input.
Single Prompt (JavaScript)
// Unnamed prompt - uses {{input}} placeholder
action.prompt('Enter package name')
.shell('npm install {{input}}')
// Named prompt - uses {{package}} placeholder
action.prompt('package', 'Enter package name')
.shell('npm install {{package}}')Multiple Prompts (JavaScript)
// Chained prompts
action
.prompt('env', 'Environment')
.prompt('version', 'Version')
.shell('deploy --env {{env}} --version {{version}}')
// Array syntax
action.prompts([
{ name: 'env', message: 'Environment' },
{ name: 'version', message: 'Version' }
]).shell('deploy --env {{env}} --version {{version}}')Prompts in JSON/YAML
{
"label": "install",
"prompt": "Package name",
"shell": "npm install {{input}}"
}{
"label": "deploy",
"prompts": [
{ "name": "env", "message": "Environment" },
{ "name": "version", "message": "Version" }
],
"shell": "deploy --env {{env}} --version {{version}}"
}Usage
# Run with default config (.quickey.js/json/yaml or package.json)
quickey
# Use a specific config file
quickey --file path/to/config.js
# Initialize a new config file
quickey --init [javascript|json|yaml]
# Show version
quickey --versionDevelopment
# Install dependencies
npm install
# Build the project
npm run build
# Run in development mode
npm run dev
# Lint the code
npm run lint
# Watch mode for development
npm run watchLicense
MIT
