Skip to content
Your first CLI command

Your first CLI command

Overview

The obx CLI is the command-center for everything Oblax. Its grammar is deterministic, predictable, and designed for automation. Every command follows the fixed structure: obx <domain> <module[:submodule...]> <action> [target] [flags].

The CLI supports interactive and non-interactive modes, with strict separation for scriptable workflows. Output formats are consistent across all actions, designed for human readability in terminal sessions.


Installation

The CLI must be installed and authenticated before use.

Verify Installation

obx version

Expected output:

obx version 0.1.0

Authenticate

obx login

Configuration

CLI Grammar — The Fixed Structure

Every obx command follows this exact pattern:

obx <domain> <module[:submodule...]> <action> [target] [flags]

Diagram:

           +--------+       +----------+     +--------+     +------+
           | domain | →     | module   | →   | action | →   | target|
           +--------+       +----------+     +--------+     +------+
                |               |               |               |
                v               v               v               v
          obx app forms get 123

Domains

DomainPurposeExample
accountAccount-level operationsobx account create
projectProject-level operationsobx project create my-proj
appApplication-domain resourcesobx app forms list

Modules (Hierarchical, : Separated)

ModuleSubmodulesDescription
forms(none)ID-based CRUD collections
bookmarks(none)ID-based CRUD collections
flux:scriptsflux:eventsKey-based semantic singletons
templates(none)Key-based semantic singletons
acl(none)HTTP-key-based (API permissions)

Actions

ActionAliasMeaning
listlsList resources
get(none)Fetch single item
init(none)Create local file template
push(none)Sync local → remote
pull(none)Sync remote → local
deldeleteRemove resource
docs(none)Open documentation

Interactive vs. Non-Interactive Mode

The Oblax CLI has a strict separation between interactive and non-interactive compatibility:

CategoryAllowedNot Allowed
obx project createInteractive (TUI)
obx app forms initInteractive
obx app forms push initNon-interactiveTUI-only commands
obx loginInteractive (opens browser)
All other actionsMust be non-interactive compatiblePure TUI commands

Rule: Only obx project create and obx login are allowed to present interactive UI. All other commands must work in non-interactive mode (scriptable, pipeable).

Output Rules

The CLI produces consistent output across all actions:

ActionOutput Format
list / lsPlain terminal table (no TUI)
getFormatted “reverse table” — line by line output. Optionally JSON with output mode
pullWrites files to disk
pushSuccess/failure messages
deleteConfirmation + success message

No output mode flags in v1. The default output is designed for human readability in terminal sessions.

CLI Shortcuts and Conventions

ShortcutEquivalentDescription
obx app forms push form.jsonobx app forms push --data @form.jsonShortcut: push from a local file
obx delete <id>obx del <id>Alias for delete
obx list <module>obx ls <module>Alias for list

Usage

Your First CLI Commands

1. Check CLI Version

obx version

2. Log In (Authentication)

obx login

This opens your default browser to the Oblax authentication page. After successful login:

  • Your JWT is stored in the CLI session
  • All subsequent commands carry your authentication token
  • You’re ready to interact with the platform

3. Create a Project (Already Done)

obx project create my-first-project

4. Initialize Your First Form

obx app forms init

Output:

| SUCCESS: Role file initialized
| Edit the initialized role file ./app/forms/init.json

5. Push the Form to Platform

obx app forms push init

Output:

| SUCCESS: Role created
| The role 'contact_form' has been successfully created on the platform.
|
| Local copy of the record is saved in ./app/forms/f2837hfd17q3phc3.json

6. List All Forms

obx app forms list

Output: Table displaying all forms in your project.

7. Get a Single Form by ID

obx app forms get f2837hfd17q3phc3

Output: Reverse-table format output of the form details.

8. Pull a Form from Platform

obx app forms pull f2837hfd17q3phc3

Output: Data for the record is written to ./app/forms/f2837hfd17q3phc3.json.

If a local file with that ID already exists, you’ll see:

| ERROR: Role pull failed
| A local version of the record exist. Use '--override' to overwrite it.

Use --override to force the pull:

obx app forms pull f2837hfd17q3phc3 --override

9. Update a Form

obx app forms push f2837hfd17q3phc3

Pushes updated data. The CLI detects whether the ID is present (update) or absent (create).

10. Delete a Form

obx app forms delete f2837hfd17q3phc3

Output: The record is deleted from the platform and the local file ./app/forms/f2837hfd17q3phc3.json is removed.

Safety: All destructive actions require confirmation:

| Are you sure you want to delete this record? (Y/N)

Use --allow-destructive-action to skip the confirmation:

obx app forms delete f2837hfd17q3phc3 --allow-destructive-action

CLI CRUD Workflow Patterns

Pattern 1: ID-Based Records (Forms, Bookmarks)

StepCommandPurpose
1obx app forms initCreate local template file
2Edit the fileAdd your data
3obx app forms push initCreate on platform → gets ID
4obx app forms push <id>Update existing record
5obx app forms pull <id>Pull from platform
6obx app forms delete <id>Delete from platform + local

Pattern 2: Key-Based Records (Flux Scripts, Templates)

StepCommandPurpose
1obx app flux:scripts init user.createdInitialize with platform-defined key
2obx app flux:scripts push user.createdPush to platform
3obx app flux:scripts pull user.deletedPull from platform
4obx app flux:scripts enable/disable <key>Enable/disable the script

Pattern 3: HTTP-Key-Based Records (ACL)

StepCommandPurpose
1obx app acl initInitialize ACL rules
2obx app acl push post@/api/v1/usersPush with method@route format
3obx app acl pull post_api_v1_usersPull by normalized filename

Common CLI Troubleshooting

IssueResolution
obx: command not foundEnsure CLI is installed and in your PATH (obx version should work)
Authentication failedRun obx login again. Your JWT may have expired.
ERROR: Role pull failedUse --override if a local file with that ID already exists
ERROR: Flux handler initialization failedVerify the key is valid for the flux:scripts module (see documentation for valid keys)
Command hangsCheck your internet connection and ensure obx version works first

Quick CLI Cheat Sheet

obx version
obx login
obx project create my-proj
obx app forms init
obx app forms push init
obx app forms list
obx app forms get <id>
obx app forms pull <id>
obx app forms delete <id>
obx app bookmarks init
obx app bookmarks list
obx app flux:scripts init user.created
obx app flux:scripts push user.created
obx app acl init
obx app acl push post@/api/v1/users

Next Steps

You’ve mastered the CLI. Now level up:

  1. Your First SDK Call — JavaScript/TypeScript integration from a web or mobile front-end
  2. Run and Deploy — production deployment, observability, and going live