Skip to content
/ cli Public
forked from n8n-incode/cli

CLI to manage workflows written in n8n-incode typescript framework

Notifications You must be signed in to change notification settings

flokixdev/cli

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

inCode CLI

A command-line interface for applying changes from your inCode workflows to your n8n instance. The inCode CLI lets you easily sync, update, and manage workflows on your n8n instance, streamlining the deployment process.

Installation

Prerequisites

  • Node.js 18+
  • npm or yarn
  • Access to an n8n instance with API access

Global Installation

npm install -g @n8n-incode/cli

Quick Start

1. Initialize a New Project

# Create a new directory for your project
mkdir my-n8n-workflows
cd my-n8n-workflows

# Initialize the inCode project
incode init

This creates a new project with the following structure:

my-n8n-workflows/
├── workflows/          # Your workflow definitions
│   └── example/        # Example workflow
├── .incode/           # inCode configuration
├── package.json       # Project dependencies
├── tsconfig.json      # TypeScript configuration
└── .gitignore         # Git ignore rules

2. Authenticate with n8n

incode login

You'll be prompted to enter:

  • Your n8n instance URL (e.g., https://n8n.example.com)
  • Your n8n API access token (found in Settings → n8n API → Create API Key)

3. Create Your First Workflow

Edit the example workflow at workflows/example/workflow.ts:

This command will:

  • Fetch all workflows from your n8n instance
  • Display workflow information including names, IDs, and status
  • Validate your local workflow definitions

Usage

Available Commands

Command Description
incode init Initialize a new inCode project in the current directory
incode login Authenticate with your n8n instance
incode pull Sync workflows from your n8n instance to local state

Command Options

incode init

  • -f, --force: Force initialization even if directory is not empty

incode login

  • Interactive guide to setup API access to your n8n instance
  • Automatically saves credentials to .incode/config.json

incode pull

  • Syncs workflows from your n8n instance to local state
  • Requires authentication (run incode login first)

Development

Development Setup

  1. Clone and Install:

    git clone https://github.com/n8n-incode/cli
    cd incode-cli
    npm install
  2. Build the Project:

    npm run build # build only
    npm run build-link # build and link for local development

Available Scripts

Script Description
npm run build Compile TypeScript and copy scaffold files
npm run dev Watch mode for TypeScript compilation
npm run build-link Build and create global link for testing
npm run copy-scaffold Copy scaffold files to dist directory

License

This project is licensed under the MIT License.

Support

About

CLI to manage workflows written in n8n-incode typescript framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 80.0%
  • JavaScript 20.0%