v1.0.0 - Modern CLI toolkit

clify

The fast, composable CLI toolkit for modern workflows

terminal
$clify init my-project
✓ Created project directory
✓ Initialized configuration
✓ Installed default plugins
Next steps:
cd my-project && clify run
01

Introduction

clify is a modern, fast, and composable CLI toolkit designed for developers who want to build powerful command-line applications without the boilerplate. It provides a clean API, built-in plugin system, and first-class TypeScript support.

Fast

Built on esbuild for lightning-fast builds. Sub-second compilation times even for large projects.

Composable

Modular architecture lets you mix and match plugins. Use only what you need.

Extensible

Rich plugin API with hooks for every lifecycle. Write custom commands and middleware.

Cross-Platform

Works on macOS, Linux, and Windows. Consistent experience across all platforms.

02

Getting Started

Installation

npm

install.sh
npm install -g clify

Homebrew

install.sh
brew install clify/cli/clify

curl

install.sh
curl -fsSL https://clify.dev/install.sh | sh

Quick Start

Initialize a new project and run your first command:

terminal
$ clify init my-app
$ cd my-app
$ clify run

System Requirements

  • -Node.js 18.0.0 or later
  • -npm, yarn, or pnpm
  • -macOS, Linux, or Windows (WSL recommended)
03

Commands Reference

clify init

Initialize a new clify project in the current directory. Creates the project structure, configuration file, and installs default plugins.

Syntax
clify init [project-name] [options]
Flags
--template <name>Project template to use (default, typescript, minimal)
--package-manager <pm>Package manager to use (npm, yarn, pnpm)
--skip-installSkip dependency installation
--forceOverwrite existing files
Example
$ clify init my-app --template typescript --package-manager pnpm
clify run

Run your CLI application in development mode with hot-reload. Watches for file changes and rebuilds automatically.

Syntax
clify run [options]
Flags
--port <port>Port to listen on (default: 3000)
--no-hmrDisable hot module replacement
--inspectEnable Node.js inspector
Example
$ clify run --port 8080 --inspect
clify build

Build your CLI application for production. Outputs optimized bundles in the configured output directory.

Syntax
clify build [options]
Flags
--target <target>Build target (node18, node20, browser)
--format <format>Output format (esm, cjs, both)
--no-minifyDisable minification
--watchWatch for changes and rebuild
Example
$ clify build --target node20 --format esm
clify deploy

Deploy your CLI application to the cloud. Supports multiple deployment targets.

Syntax
clify deploy [target] [options]
Flags
--region <region>Deployment region
--no-cacheDisable build caching
--dry-runPreview deployment without applying
Example
$ clify deploy aws --region us-east-1
clify config

View or modify your project configuration. Lists all current settings and allows targeted updates.

Syntax
clify config [key] [value] [options]
Flags
--listList all configuration values
--jsonOutput as JSON
--globalAccess global configuration
Example
$ clify config build.target node20
clify help

Display help information for any command. Shows usage, flags, and examples.

Syntax
clify help [command] [options]
Flags
--allShow help for all commands
--jsonOutput help as JSON
Example
$ clify help build
04

Examples

Creating a CLI tool with TypeScript

Initialize a TypeScript project and set up plugins for type-safe development.

example-1.sh
# Create a new TypeScript project
$ clify init my-tool --template typescript

# Navigate into the project
$ cd my-tool

# Start development with hot-reload
$ clify run

# In another terminal, test your CLI
$ node dist/index.js --help

Building a multi-command application

Use the plugin system to create a feature-rich CLI with subcommands.

example-2.sh
# Generate a command scaffold
$ clify init task-manager
$ cd task-manager

# Add custom commands via plugins
$ clify plugin add database
$ clify plugin add logging

# List available commands
$ clify help

# Use the task manager
$ clify task-manager add "Write docs" --priority high
$ clify task-manager list --status pending

Continuous deployment pipeline

Automate builds and deployments as part of your CI workflow.

example-3.sh
# Build for production
$ clify build --target node20 --format esm --minify

# Run tests
$ clify test --coverage

# Deploy to production
$ clify deploy aws --region us-east-1 --no-cache

# Verify deployment
$ clify health --endpoint https://api.example.com/health

Custom plugin development

Extend clify with your own plugins for domain-specific functionality.

example-4.sh
# Create a new plugin
$ clify plugin init my-plugin
$ cd my-plugin

# Edit the plugin handler
$ cat > src/index.ts << 'EOF'
export default {
  name: "my-plugin",
  hooks: {
    "build:start": (ctx) => {
      console.log("Build started!", ctx.config);
    },
    "build:end": (ctx) => {
      console.log("Build completed in", ctx.duration, "ms");
    },
  },
};
EOF

# Test your plugin
$ clify build --plugin my-plugin
05

Configuration

clify is configured via a clify.config.js or clify.config.ts file at the root of your project.

clify.config.js
export default {
  // Project name used in logs and output
  name: "my-app",

  // Entry point for your CLI
  entry: "./src/index.ts",

  // Output directory for builds
  output: "./dist",

  // Plugins to extend functionality
  plugins: [
    "typescript",
    "esbuild",
    "testing"
  ],

  // Build configuration
  build: {
    target: "node18",
    format: "esm",
    minify: true,
    sourcemap: true,
  },

  // Development server settings
  dev: {
    port: 3000,
    hotReload: true,
  },

  // Custom commands
  commands: {
    greet: {
      description: "Greet a user",
      handler: async (name) => {
        console.log(`Hello, ${name}! Welcome to clify.`);
      },
    },
  },
};

Configuration Options

OptionTypeDefaultDescription
namestringundefinedProject name used in logs and output
entrystring./src/index.tsEntry point for your CLI
outputstring./distOutput directory for builds
pluginsstring[][]Array of plugin names to use
build.targetstringnode18Node.js target version
build.formatstringesmModule format (esm, cjs, both)
build.minifybooleantrueEnable minification
build.sourcemapbooleantrueGenerate sourcemaps
dev.portnumber3000Development server port
dev.hotReloadbooleantrueEnable hot reload
06

Contributing

We welcome contributions from the community! Whether you are fixing a bug, adding a feature, or improving documentation, your help makes clify better for everyone.

How to Contribute

  1. 1

    Fork the repository

    Create a fork of clify on GitHub and clone it locally.

  2. 2

    Create a branch

    Create a feature branch for your changes.

  3. 3

    Make your changes

    Implement your feature or fix. Write tests and update documentation.

  4. 4

    Run tests

    Ensure all tests pass and your changes follow the code style.

  5. 5

    Submit a pull request

    Open a PR with a clear description of your changes and reference any related issues.

Code of Conduct

clify is committed to fostering a welcoming and inclusive community.

View Code of Conduct