BizKitHub
DocsTerminal
Command-Line Interface

BizKitHub Terminal

A web-based command-line interface built into the BizKitHub platform. Manage files, execute commands, and automate tasks through a familiar shell-like experience -- directly in your browser.

BizKitHub Terminal is built on a custom shell implementation featuring its own parser and process execution engine. It follows Unix shell conventions while being purpose-built for the platform.

Command Piping & Chaining

Chain commands using pipes, conditional operators, and sequential execution just like a traditional shell.

Interactive Prompts

Commands can request user input at runtime with confirmations, selections, text fields, and password inputs.

Smart Autocomplete

Context-aware suggestions for commands, subcommands, parameters, flags, and file paths based on cursor position.

Structured Output

Commands return typed outputs including tables, JSON, file downloads, progress indicators, and redirects.

Aliases & History

Define custom shorthand aliases for frequent commands and search through your full command history.

Virtual File System

Navigate and manage files within the /drive virtual filesystem with familiar commands like ls, cd, cat, and tree.

Shell Architecture

The terminal is powered by a custom-built shell engine with its own input parser and pipeline executor. It follows familiar Unix shell semantics while being fully integrated with the BizKitHub platform.

1

Input Parsing

The custom parser tokenizes raw input with full support for single and double quotes, escape sequences, short flags (-l, -la), long flags (--all, --include=*.ts), and pipeline operators.

2

Pipeline Construction

Parsed tokens are assembled into a structured pipeline -- a sequence of commands connected by operators (|, &&, ||, ;) that define execution flow and data passing.

3

Command Resolution

Each command is resolved through the registry. Aliases are expanded, subcommands are matched (e.g., date:now), and parameters are validated against the command definition.

4

Execution & Output

The pipeline executor runs commands sequentially, passing output between piped stages and evaluating conditional operators. Each command returns structured, typed output.

Pipeline Operators

Combine commands using familiar shell operators for powerful workflows.

|Pipe

Passes stdout of the previous command as stdin to the next

&&AND

Runs the next command only if the previous one succeeded

||OR

Runs the next command only if the previous one failed

;Sequence

Runs the next command regardless of the previous result

examples
# Pipe output from ls to echo
ls --long | echo

# Run cleanup only if backup succeeds
du /drive && history:clear

# Show calendar or fall back to current date
date:calendar || date:now

# Run multiple commands in sequence
whoami ; env ; pwd

Available Commands

A complete set of built-in commands organized by category. All commands support the subcommand syntax using colons.

System

helpList available commands and syntax guide
whoamiCurrent user information (JSON)
envOrganization environment variables (table)
echo <text>Print text, supports stdin from pipe
clearClear the terminal screen
pwdPrint current working directory
cd <path>Change working directory

File Management

ls [path]List directory (--long for details, --all for hidden)
cat <file>Display text file content or binary file metadata
file <file>Detailed file info (size, type, URL)
mkdir <path>Create a new directory
mv <file> <name>Rename a file
du [path]Disk usage -- file count and total size
tree [path]Directory tree view (--depth N, default 3)

Date & Time

date:nowCurrent timestamp (ISO 8601)
date:info [date]Detailed date breakdown (table)
date:diff from=DATE to=DATEDifference between two dates
date:convert date=D from=TZ to=TZTimezone conversion
date:calendar [month=N] [year=N]ASCII calendar with current day highlighted
date:uptimeServer uptime, Node.js version, memory

Aliases & History

alias:listList all aliases
alias:set <name> <command>Create or update an alias
alias:remove <name>Delete an alias
historyCommand history with search
history:clearClear command history

Note: Date commands support --format (iso, unix, utc, short, relative) and --timezone (IANA format, defaults to Europe/Prague). Users can create up to 50 aliases.

Structured Output Types

Every command returns an array of typed outputs. The client renders each output according to its type, providing a rich and consistent experience.

textPlain text with optional styling
tableTable with columns, rows, and total count
jsonJSON object
fileFile download link (URL, name, size)
progressProgress indicator (current / total)
redirectURL redirect
promptInteractive user prompt

Interactive Prompts

Commands can pause execution and request user input at runtime. The terminal supports four prompt types with a 5-minute response timeout.

confirmYes / no confirmation
inputFree-form text input
selectChoose from predefined options
passwordHidden text field for sensitive input

Limitation: Interactive prompts are not available inside pipelines (when using the | operator).

REST API

The terminal is fully accessible via REST API. All endpoints require authentication and are prefixed with /terminal.

POST/terminal/session
Initialize session, returns MOTD and user info
POST/terminal/execute
Execute a command
POST/terminal/interact
Respond to an interactive prompt
POST/terminal/cancel
Cancel a running command
GET/terminal/suggest
Autocomplete suggestions
GET/terminal/commands
List available commands for current role
GET/terminal/history
Command history with pagination and search
DELETE/terminal/history
Clear command history
GET/terminal/aliases
List all aliases
POST/terminal/aliases
Create or update an alias
DELETE/terminal/aliases
Delete an alias

Execute Command

POST /terminal/execute
{
  "input": "ls --long"
}

// Response
{
  "commandId": "abc123",
  "outputs": [
    {
      "type": "table",
      "columns": ["name", "size", "modified"],
      "rows": [...]
    }
  ],
  "status": "done",
  "cwd": "/drive",
  "duration": 42
}

Interactive Flow

// 1. Command requires confirmation
POST /terminal/execute
{ "input": "rm secret.txt" }
// → status: "awaiting_input"
// → outputs contain prompt

// 2. User responds
POST /terminal/interact
{
  "commandId": "abc123",
  "interactionId": "xyz",
  "value": true
}
// → status: "done"

Autocomplete

The terminal provides context-aware suggestions based on the current cursor position. The system analyzes the parsed input and offers relevant completions.

Commands

Suggested when no command has been entered yet

Subcommands

Offered when the current command has defined subcommands

Parameters & Flags

Based on the current command's definition

File Paths

Completed from the virtual file system

GET /terminal/suggest?input=date:&cursor=5

// Response
{
  "suggestions": [
    { "type": "subcommand", "value": "now", "description": "Current timestamp" },
    { "type": "subcommand", "value": "info", "description": "Date details" },
    { "type": "subcommand", "value": "diff", "description": "Date difference" },
    { "type": "subcommand", "value": "convert", "description": "Timezone conversion" },
    { "type": "subcommand", "value": "calendar", "description": "ASCII calendar" }
  ]
}

Session & MOTD

Each terminal session starts with an initialization call that returns a welcome message (MOTD) and establishes the user context.

BizKitHub Terminal v1.0
Session started at 2024-03-15T14:30:00Z
Logged in as john@acme.com (Acme Corp)
Client IP: 192.168.1.100
Type "help" for available commands.
/drive $

Session Context

  • User identity, role, and organization
  • Working directory (defaults to /drive)
  • 5-minute timeout for pending interactions

Virtual File System

The terminal operates on a virtual file system rooted at /drive. Files are identified by tokens (32-character hex identifiers) or by name.

Paths support relative navigation with .. and . and are automatically normalized. Use standard commands like ls, cd, cat, tree, and mkdir to interact with the file system.

lscdcatfilemkdirmvdutree
file system
/drive $ tree --depth 2
/drive
├── documents/
│   ├── contracts/
│   └── invoices/
├── images/
│   ├── logo.png
│   └── banner.jpg
├── exports/
│   └── report-2024.csv
└── readme.txt

4 directories, 4 files

Explore the full API

Dive into the complete API documentation to integrate the terminal into your workflows, or try it directly in the interactive explorer.