콘텐츠로 이동

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.

The easiest way to experience Actionbase is using Docker. The standalone image runs the server in the background and the CLI in the foreground:

Terminal window
docker run -it --pull always ghcr.io/kakao/actionbase:standalone

This is sufficient for exploring Actionbase and understanding its core capabilities.

Terminal window
actionbase [options]
OptionDescriptionDefault
--host <url>Actionbase server URLhttp://localhost:8080
--authKey <key>Authentication key(none)
--debugEnable debug logging (shows HTTP requests/responses)off
--plainPlain text output mode (no colors)off
--proxy [port]Start in proxy mode for interactive guides9300
--versionDisplay CLI version and exit
Terminal window
# Connect to local server
actionbase
# Connect to remote server
actionbase --host https://actionbase.example.com
# Enable debug mode to see HTTP traffic
actionbase --debug
# Start with proxy mode for guides
actionbase --proxy

The CLI maintains session context for database and table selection. The prompt displays the current context:

actionbase> # No context
actionbase(mydb)> # Database selected
actionbase(mydb:mytable)> # Database and table selected

Display current session state.

context

Output 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>
SubcommandDescription
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":[...]}

Create databases, storages, tables, or aliases.

create database --name <name> --comment <comment>
FlagRequiredDescription
--nameYesDatabase name
--commentYesDatabase description

Example:

actionbase> create database --name social --comment "Social interactions"
│ Database created: social
create storage --name <name> --comment <comment> --storageType <type> --hbaseNamespace <ns> --hbaseTable <table>
FlagRequiredDescription
--nameYesStorage name
--commentYesStorage description
--storageTypeYesStorage type
--hbaseNamespaceYesHBase namespace
--hbaseTableYesHBase table name
create table --database <db> --storage <storage> --name <name> --comment <comment> --type <type> --direction <direction> --schema <schema> [--indices <indices>] [--groups <groups>]
FlagRequiredDescription
--databaseYesDatabase name
--storageYesStorage name
--nameYesTable name
--commentYesTable description
--typeYesTable type
--directionYesDirection type (IN, OUT, BOTH)
--schemaYesJSON schema definition
--indicesNoJSON array of index definitions
--groupsNoJSON array of group definitions
create alias --database <db> --table <table> --name <name> --comment <comment>
FlagRequiredDescription
--databaseYesDatabase name
--tableYesTable name
--nameYesAlias name
--commentYesAlias description

Display databases, storages, tables, aliases, indices, or groups.

show <databases|storages|tables|aliases|indices|groups> [--using <table|alias>]
SubcommandContext RequiredDescription
show databasesNoneList all databases
show storagesNoneList all storages with configuration
show tablesDatabaseList tables in current database
show aliasesDatabaseList aliases in current database
show indicesDatabase + TableShow indices for current or specified table
show groupsDatabase + TableShow 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 |
│ |------------|------|----------|

Query a specific edge by source and target.

get [<table>] --source <source> --target <target>
FlagRequiredDescription
[table]NoTable or alias name (uses current if omitted)
--sourceYesSource node ID
--targetYesTarget 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>]
FlagRequiredDescription
[table]NoTable or alias name (uses current if omitted)
--indexYesIndex name to scan
--startYesStarting node ID
--directionYesScan direction: IN, OUT, or BOTH
--rangesNoRange specification for filtering
--limitNoMaximum 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>
FlagRequiredDescription
[table]NoTable or alias name (uses current if omitted)
--startYesStarting node ID
--directionYesDirection: 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 |
│ |-------|-------|

Insert, update, or delete edges.

mutate [<table>] --type <type> --source <source> --target <target> --version <version> --properties <properties>
FlagRequiredDescription
[table]NoTable or alias name (uses current if omitted)
--typeYesMutation type: INSERT, UPDATE, or DELETE
--sourceYesSource node ID
--targetYesTarget node ID
--versionYesTimestamp/version (supports $NOW placeholder)
--propertiesYesJSON 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 failed

Load and execute commands from a YAML file or preset.

load <file|preset> <path> [--ref <branch>]

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'

Download and execute a preset from the Actionbase GitHub repository:

load preset <name> [--ref <branch>]
FlagRequiredDescription
<name>YesPreset name
--refNoGit branch or tag reference

Available presets:

PresetDescription
likesSample likes data (Alice/Bob liking Phone/Laptop)
hands-on-socialSocial media application demo data

Example:

actionbase> load preset likes
│ 3 edges inserted
│ - Alice → Phone
│ - Alice → Laptop
│ - Bob → Phone

Start an interactive guide. Requires proxy mode (--proxy flag at startup).

guide start <name>

Available guides:

GuideDescription
hands-on-socialInteractive social media application tutorial

Example:

Terminal window
# Start CLI with proxy mode
actionbase --proxy
# Then start the guide
actionbase> guide start hands-on-social

The guide opens a browser-based interactive tutorial that sends commands to the CLI.

Display all available commands with descriptions and usage.

help

Example:

actionbase> help
│ Available commands
│ |---------|-------------------------------|----------------------------------------|
│ | NAME | DESCRIPTION | USAGE |
│ |---------|-------------------------------|----------------------------------------|
│ | context | Show current status | `context` |
│ | create | Create database/storage/... | `create <database|storage|table|...>` |
│ | ... | ... | ... |
│ |---------|-------------------------------|----------------------------------------|

Exit the CLI console.

exit

You can also press Ctrl+C or Ctrl+D to exit.

# 1. Load sample data using preset
actionbase> load preset likes
# 2. Check current context (database and table are set automatically)
actionbase(likes:likes)> context
# 3. Query a specific edge
actionbase(likes:likes)> get --source Alice --target Phone
# 4. Scan all edges from Alice
actionbase(likes:likes)> scan --index created_at_desc --start Alice --direction OUT
# 5. Count edges
actionbase(likes:likes)> count --start Phone --direction IN
# 1. Select database and table
actionbase> use database social
actionbase(social)> use table follows
# 2. Insert an edge
actionbase(social:follows)> mutate --type INSERT --source user1 --target user2 --version $NOW --properties '{"created_at": $NOW}'
# 3. Verify the edge
actionbase(social:follows)> get --source user1 --target user2
# 4. Delete the edge
actionbase(social:follows)> mutate --type DELETE --source user1 --target user2 --version $NOW --properties '{}'
Terminal window
# Start CLI with proxy mode enabled
actionbase --proxy
# Start the interactive guide
actionbase> guide start hands-on-social

The guide opens in your browser and walks you through building a social media application.

ValueDescription
OUTOutgoing edges (source → target)
INIncoming edges (target ← source)
BOTHBoth directions
TypeDescription
INSERTCreate a new edge
UPDATEUpdate an existing edge
DELETEDelete an edge
CommandDatabase RequiredTable Required
create databaseNoNo
create storageNoNo
create tableNoNo
create aliasNoNo
show databasesNoNo
show storagesNoNo
show tablesYesNo
show aliasesYesNo
show indicesYesYes (or specify)
show groupsYesYes (or specify)
desc tableYesNo (uses current)
desc aliasYesNo (uses current)
getYesYes (or specify)
scanYesYes (or specify)
countYesYes (or specify)
mutateYesYes (or specify)

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.