CLI
이 콘텐츠는 아직 번역되지 않았습니다.
The Actionbase CLI provides an interactive console for managing databases, tables, and edges. It connects to an Actionbase server and supports all metadata and data operations.
Installation
Section titled “Installation”The easiest way to experience Actionbase is using Docker. The standalone image runs the server in the background and the CLI in the foreground:
docker run -it --pull always ghcr.io/kakao/actionbase:standaloneThis is sufficient for exploring Actionbase and understanding its core capabilities.
brew tap kakao/actionbase https://github.com/kakao/actionbasebrew install actionbasegit clone https://github.com/kakao/actionbase.gitcd actionbase/climake buildThe binary is created at cli/bin/actionbase.
Starting the CLI
Section titled “Starting the CLI”actionbase [options]Startup Options
Section titled “Startup Options”| Option | Description | Default |
|---|---|---|
--host <url> | Actionbase server URL | http://localhost:8080 |
--authKey <key> | Authentication key | (none) |
--debug | Enable debug logging (shows HTTP requests/responses) | off |
--plain | Plain text output mode (no colors) | off |
--proxy [port] | Start in proxy mode for interactive guides | 9300 |
--version | Display CLI version and exit |
Examples
Section titled “Examples”# Connect to local serveractionbase
# Connect to remote serveractionbase --host https://actionbase.example.com
# Enable debug mode to see HTTP trafficactionbase --debug
# Start with proxy mode for guidesactionbase --proxyContext Management
Section titled “Context Management”The CLI maintains session context for database and table selection. The prompt displays the current context:
actionbase> # No contextactionbase(mydb)> # Database selectedactionbase(mydb:mytable)> # Database and table selectedcontext
Section titled “context”Display current session state.
contextOutput includes:
- Current host URL
- Current database
- Current table or alias
- Proxy mode status (on/off with port)
- Debug mode status (on/off)
Example:
actionbase> context │ |----------|--------------------------------| │ | KEY | VALUE | │ |----------|--------------------------------| │ | host | http://localhost:8080 | │ | database | likes | │ | table | likes | │ | alias | | │ | proxy | off (port -) | │ | debug | off | │ |----------|--------------------------------|Switch the current database, table, or alias context.
use <database|table|alias> <name>| Subcommand | Description |
|---|---|
use database <name> | Switch to specified database (clears table/alias context) |
use table <name> | Switch to specified table (requires database context) |
use alias <name> | Switch to specified alias (requires database context) |
Examples:
actionbase> use database likes │ Current database: likes
actionbase(likes)> use table likes │ Current table: likes
actionbase(likes:likes)>Enable or disable debug mode. When enabled, HTTP requests and responses are logged.
debug <on|off>Example:
actionbase> debug on │ Debugging is on
actionbase> get --source Alice --target Phone │ → GET /graph/v3/databases/likes/tables/likes/edges/get?source=Alice&target=Phone │ ← 200 OK {"edges":[...]}Metadata Operations
Section titled “Metadata Operations”create
Section titled “create”Create databases, storages, tables, or aliases.
create database
Section titled “create database”create database --name <name> --comment <comment>| Flag | Required | Description |
|---|---|---|
--name | Yes | Database name |
--comment | Yes | Database description |
Example:
actionbase> create database --name social --comment "Social interactions" │ Database created: socialcreate storage
Section titled “create storage”create storage --name <name> --comment <comment> --storageType <type> --hbaseNamespace <ns> --hbaseTable <table>| Flag | Required | Description |
|---|---|---|
--name | Yes | Storage name |
--comment | Yes | Storage description |
--storageType | Yes | Storage type |
--hbaseNamespace | Yes | HBase namespace |
--hbaseTable | Yes | HBase table name |
create table
Section titled “create table”create table --database <db> --storage <storage> --name <name> --comment <comment> --type <type> --direction <direction> --schema <schema> [--indices <indices>] [--groups <groups>]| Flag | Required | Description |
|---|---|---|
--database | Yes | Database name |
--storage | Yes | Storage name |
--name | Yes | Table name |
--comment | Yes | Table description |
--type | Yes | Table type |
--direction | Yes | Direction type (IN, OUT, BOTH) |
--schema | Yes | JSON schema definition |
--indices | No | JSON array of index definitions |
--groups | No | JSON array of group definitions |
create alias
Section titled “create alias”create alias --database <db> --table <table> --name <name> --comment <comment>| Flag | Required | Description |
|---|---|---|
--database | Yes | Database name |
--table | Yes | Table name |
--name | Yes | Alias name |
--comment | Yes | Alias description |
Display databases, storages, tables, aliases, indices, or groups.
show <databases|storages|tables|aliases|indices|groups> [--using <table|alias>]| Subcommand | Context Required | Description |
|---|---|---|
show databases | None | List all databases |
show storages | None | List all storages with configuration |
show tables | Database | List tables in current database |
show aliases | Database | List aliases in current database |
show indices | Database + Table | Show indices for current or specified table |
show groups | Database + Table | Show groups for current or specified table |
Examples:
actionbase> show databases │ |-------|---------| │ | NAME | DESC | │ |-------|---------| │ | likes | Likes | │ | social| Social | │ |-------|---------|
actionbase(likes)> show tables │ |-------|------|-----------| │ | NAME | TYPE | DIRECTION | │ |-------|------|-----------| │ | likes | ... | BOTH | │ |-------|------|-----------|
actionbase(likes:likes)> show indices │ |------------------|--------| │ | NAME | FIELDS | │ |------------------|--------| │ | created_at_desc | ... | │ |------------------|--------|Describe table or alias details including schema, fields, and indices.
desc <table|alias> [<name>]If <name> is omitted, describes the current table or alias.
Example:
actionbase(likes)> desc table likes │ Table: likes │ Type: INDEXED │ Direction: BOTH │ │ Source: STRING │ Target: STRING │ │ Fields: │ |------------|------|----------| │ | NAME | TYPE | NULLABLE | │ |------------|------|----------| │ | created_at | LONG | false | │ |------------|------|----------|Data Operations
Section titled “Data Operations”Query a specific edge by source and target.
get [<table>] --source <source> --target <target>| Flag | Required | Description |
|---|---|---|
[table] | No | Table or alias name (uses current if omitted) |
--source | Yes | Source node ID |
--target | Yes | Target node ID |
Example:
actionbase(likes:likes)> get --source Alice --target Phone │ The edge is found: [Alice -> Phone] │ |---------------|--------|--------|---------------------------| │ | VERSION | SOURCE | TARGET | PROPERTIES | │ |---------------|--------|--------|---------------------------| │ | 1737377177245 | Alice | Phone | created_at: 1737377177245 | │ |---------------|--------|--------|---------------------------|Scan edges using an index.
scan [<table>] --index <index> --start <start> --direction <direction> [--ranges <ranges>] [--limit <limit>]| Flag | Required | Description |
|---|---|---|
[table] | No | Table or alias name (uses current if omitted) |
--index | Yes | Index name to scan |
--start | Yes | Starting node ID |
--direction | Yes | Scan direction: IN, OUT, or BOTH |
--ranges | No | Range specification for filtering |
--limit | No | Maximum rows to return (default: 25) |
Example:
actionbase(likes:likes)> scan --index created_at_desc --start Alice --direction OUT │ The 2 edges found (offset: -, hasNext: false) │ |---|---------------|--------|--------|---------------------------| │ | # | VERSION | SOURCE | TARGET | PROPERTIES | │ |---|---------------|--------|--------|---------------------------| │ | 1 | 1737377177297 | Alice | Laptop | created_at: 1737377177297 | │ | 2 | 1737377177245 | Alice | Phone | created_at: 1737377177245 | │ |---|---------------|--------|--------|---------------------------|Count edges for a specific node and direction.
count [<table>] --start <start> --direction <direction>| Flag | Required | Description |
|---|---|---|
[table] | No | Table or alias name (uses current if omitted) |
--start | Yes | Starting node ID |
--direction | Yes | Direction: IN, OUT, or BOTH |
Example:
actionbase(likes:likes)> count --start Alice --direction OUT │ |-------|-------| │ | DIR | COUNT | │ |-------|-------| │ | OUT | 2 | │ |-------|-------|
actionbase(likes:likes)> count --start Phone --direction IN │ |-------|-------| │ | DIR | COUNT | │ |-------|-------| │ | IN | 2 | │ |-------|-------|mutate
Section titled “mutate”Insert, update, or delete edges.
mutate [<table>] --type <type> --source <source> --target <target> --version <version> --properties <properties>| Flag | Required | Description |
|---|---|---|
[table] | No | Table or alias name (uses current if omitted) |
--type | Yes | Mutation type: INSERT, UPDATE, or DELETE |
--source | Yes | Source node ID |
--target | Yes | Target node ID |
--version | Yes | Timestamp/version (supports $NOW placeholder) |
--properties | Yes | JSON object with edge properties (supports $NOW) |
Example:
actionbase(likes:likes)> mutate --type INSERT --source Charlie --target Phone --version $NOW --properties '{"created_at": $NOW}' │ Mutation result: 1 updated, 0 failedUtility Commands
Section titled “Utility Commands”Load and execute commands from a YAML file or preset.
load <file|preset> <path> [--ref <branch>]load file
Section titled “load file”Load commands from a local YAML file:
load file <path>YAML file format:
- name: 'Create database' description: 'Optional description' command: "create database --name mydb --comment 'My database'"
- name: 'Use database' command: 'use database mydb'load preset
Section titled “load preset”Download and execute a preset from the Actionbase GitHub repository:
load preset <name> [--ref <branch>]| Flag | Required | Description |
|---|---|---|
<name> | Yes | Preset name |
--ref | No | Git branch or tag reference |
Available presets:
| Preset | Description |
|---|---|
likes | Sample likes data (Alice/Bob liking Phone/Laptop) |
hands-on-social | Social media application demo data |
Example:
actionbase> load preset likes │ 3 edges inserted │ - Alice → Phone │ - Alice → Laptop │ - Bob → PhoneStart an interactive guide. Requires proxy mode (--proxy flag at startup).
guide start <name>Available guides:
| Guide | Description |
|---|---|
hands-on-social | Interactive social media application tutorial |
Example:
# Start CLI with proxy modeactionbase --proxy
# Then start the guideactionbase> guide start hands-on-socialThe guide opens a browser-based interactive tutorial that sends commands to the CLI.
Display all available commands with descriptions and usage.
helpExample:
actionbase> help │ Available commands │ |---------|-------------------------------|----------------------------------------| │ | NAME | DESCRIPTION | USAGE | │ |---------|-------------------------------|----------------------------------------| │ | context | Show current status | `context` | │ | create | Create database/storage/... | `create <database|storage|table|...>` | │ | ... | ... | ... | │ |---------|-------------------------------|----------------------------------------|Exit the CLI console.
exitYou can also press Ctrl+C or Ctrl+D to exit.
Common Workflows
Section titled “Common Workflows”Quick Start: Create and Query Data
Section titled “Quick Start: Create and Query Data”# 1. Load sample data using presetactionbase> load preset likes
# 2. Check current context (database and table are set automatically)actionbase(likes:likes)> context
# 3. Query a specific edgeactionbase(likes:likes)> get --source Alice --target Phone
# 4. Scan all edges from Aliceactionbase(likes:likes)> scan --index created_at_desc --start Alice --direction OUT
# 5. Count edgesactionbase(likes:likes)> count --start Phone --direction INData Operations Workflow
Section titled “Data Operations Workflow”# 1. Select database and tableactionbase> use database socialactionbase(social)> use table follows
# 2. Insert an edgeactionbase(social:follows)> mutate --type INSERT --source user1 --target user2 --version $NOW --properties '{"created_at": $NOW}'
# 3. Verify the edgeactionbase(social:follows)> get --source user1 --target user2
# 4. Delete the edgeactionbase(social:follows)> mutate --type DELETE --source user1 --target user2 --version $NOW --properties '{}'Interactive Learning with Guides
Section titled “Interactive Learning with Guides”# Start CLI with proxy mode enabledactionbase --proxy
# Start the interactive guideactionbase> guide start hands-on-socialThe guide opens in your browser and walks you through building a social media application.
Reference
Section titled “Reference”Direction Values
Section titled “Direction Values”| Value | Description |
|---|---|
OUT | Outgoing edges (source → target) |
IN | Incoming edges (target ← source) |
BOTH | Both directions |
Mutation Types
Section titled “Mutation Types”| Type | Description |
|---|---|
INSERT | Create a new edge |
UPDATE | Update an existing edge |
DELETE | Delete an edge |
Context Requirements
Section titled “Context Requirements”| Command | Database Required | Table Required |
|---|---|---|
create database | No | No |
create storage | No | No |
create table | No | No |
create alias | No | No |
show databases | No | No |
show storages | No | No |
show tables | Yes | No |
show aliases | Yes | No |
show indices | Yes | Yes (or specify) |
show groups | Yes | Yes (or specify) |
desc table | Yes | No (uses current) |
desc alias | Yes | No (uses current) |
get | Yes | Yes (or specify) |
scan | Yes | Yes (or specify) |
count | Yes | Yes (or specify) |
mutate | Yes | Yes (or specify) |
Special Features
Section titled “Special Features”Multi-line input: End a line with \ to continue on the next line.
actionbase> create table --database mydb --name mytable \ --comment "My table" --type INDEXED --direction BOTH \ --schema '{"src":{"type":"STRING"},"tgt":{"type":"STRING"}}'Quote handling: Input automatically continues until quotes are balanced.