Skip to content

KimKaoPoo/tm1cli

tm1cli

Release Downloads Go License CI

A command-line tool for IBM TM1 / Planning Analytics REST API.

Manage TM1 servers, list cubes and dimensions, run TI processes, and export data — all from the terminal.

Features

  • Multi-server config — save and switch between TM1 server connections
  • Cubes & Dimensions — list, filter, and browse cube structures and dimension members
  • TI Processes — list and execute TurboIntegrator processes with parameters
  • Data Export — export cube views to screen, CSV, JSON, or XLSX
  • Flexible output — table or JSON format, with filtering and pagination
  • Secure — no hardcoded credentials; supports environment variable overrides

Install

Homebrew (macOS / Linux)

brew install KimKaoPoo/tap/tm1cli

Or:

brew tap KimKaoPoo/tap
brew install tm1cli

Download binary

Download the latest release for your platform from Releases.

macOS (Apple Silicon):

curl -Lo tm1cli.tar.gz https://github.com/KimKaoPoo/tm1cli/releases/latest/download/tm1cli_0.1.2_darwin_arm64.tar.gz
tar xzf tm1cli.tar.gz
sudo mv tm1cli /usr/local/bin/

macOS (Intel):

curl -Lo tm1cli.tar.gz https://github.com/KimKaoPoo/tm1cli/releases/latest/download/tm1cli_0.1.2_darwin_amd64.tar.gz
tar xzf tm1cli.tar.gz
sudo mv tm1cli /usr/local/bin/

Linux (x86_64):

curl -Lo tm1cli.tar.gz https://github.com/KimKaoPoo/tm1cli/releases/latest/download/tm1cli_0.1.2_linux_amd64.tar.gz
tar xzf tm1cli.tar.gz
sudo mv tm1cli /usr/local/bin/

Linux (ARM64):

curl -Lo tm1cli.tar.gz https://github.com/KimKaoPoo/tm1cli/releases/latest/download/tm1cli_0.1.2_linux_arm64.tar.gz
tar xzf tm1cli.tar.gz
sudo mv tm1cli /usr/local/bin/

Windows:

Download tm1cli_0.1.2_windows_amd64.zip from Releases, extract, and add tm1cli.exe to your PATH.

Go install

go install github.com/KimKaoPoo/tm1cli@latest

From source

Requires Go 1.22+

git clone https://github.com/KimKaoPoo/tm1cli.git
cd tm1cli
make build

The binary is built to ./tm1cli. Optionally install to PATH:

make install   # copies to /usr/local/bin

Quick Start

# Add your TM1 server connection (interactive)
tm1cli config add myserver

# List cubes
tm1cli cubes

# List dimensions
tm1cli dims

# Browse dimension members
tm1cli dims members Period

# Run a TI process
tm1cli process run "LoadData" --param pSource=file.csv

# Export a cube view
tm1cli export "Sales" --view "Default"

Configuration

Connections are stored in ~/.tm1cli/config.json.

tm1cli config add myserver          # add a connection (interactive)
tm1cli config list                  # list all connections
tm1cli config use production        # switch active connection
tm1cli config remove old_server     # remove a connection
tm1cli config settings              # view default settings
tm1cli config settings --limit 100  # change defaults

Environment Variables

Variable Description
TM1CLI_SERVER Override active connection
TM1CLI_OUTPUT Override output format (table or json)
TM1CLI_PASSWORD Override stored password (recommended for CI/CD)

Password Security

Passwords are stored in the OS keychain (macOS Keychain, Linux secret-service/libsecret, Windows Credential Manager). If the keychain is unavailable (e.g., headless Linux without D-Bus), tm1cli falls back to base64-encoded storage in the config file and prints a warning — base64 is obfuscation only, not encryption.

For CI/CD or headless environments, prefer the TM1CLI_PASSWORD environment variable.

Config file portability: The password_ref in the config file is a machine-local keychain lookup key. Copying ~/.tm1cli/config.json to another machine will not copy the passwords — re-enter them there via tm1cli config edit <name>. Keychain entries are scoped to the OS user account.

Migrating existing base64 passwords: Existing configs with base64-stored passwords continue to work unchanged. To move an individual connection into the keychain, run tm1cli config edit <name> and re-enter your password at the prompt.

Usage

Cubes

tm1cli cubes                        # list cubes (default limit: 50)
tm1cli cubes --filter "ledger"      # filter by name
tm1cli cubes --all                  # show all (no limit)
tm1cli cubes --show-system          # include system cubes (} prefix)
tm1cli cubes --count                # count only
tm1cli cubes --output json          # JSON output

Dimensions & Members

tm1cli dims                                # list dimensions
tm1cli dims members Period                 # list elements (indented tree by default)
tm1cli dims members Period --flat          # flat list, no indentation
tm1cli dims members Region --hierarchy "Alternate Region"
tm1cli dims members Account --filter "Rev" # --filter forces a flat list

Children of consolidated elements are indented two spaces per level. Use --flat for a single-level list. Indentation is disabled automatically with --filter, --count, and --output json.

Processes

tm1cli process list                        # list TI processes
tm1cli process list --filter "load"
tm1cli process run "LoadData"              # run without params
tm1cli process run "LoadData" --param pSource=file.csv --param pYear=2024

Threads

tm1cli threads list                       # list running threads
tm1cli threads list --state Run           # filter by state (Idle|Run|Wait|CommitWait|Rollback)
tm1cli threads list --user Admin          # filter by user (partial, case-insensitive)
tm1cli threads list --min-elapsed 10s     # threads running longer than 10 seconds
tm1cli threads list --all                 # no 50-row limit
tm1cli threads list --output json         # full 14-field JSON output

Logs

tm1cli logs messages                           # show last 100 message log entries (default)
tm1cli logs messages --tail 50                 # show last 50 entries
tm1cli logs messages --since 1h               # entries from the past hour
tm1cli logs messages --since 2026-04-24T10:00 # absolute timestamp (local time when no offset)
tm1cli logs messages --level error            # filter by level: info, warn, error, fatal, debug
tm1cli logs messages --user admin             # filter by user (client-side, partial match)
tm1cli logs messages --contains "load"        # filter by message substring (case-insensitive)
tm1cli logs messages --follow                  # stream new entries kubectl-style (Ctrl+C to stop)
tm1cli logs messages --follow --interval 10s  # custom poll interval
tm1cli logs messages --raw                     # raw one-line-per-entry output
tm1cli logs messages --output json            # JSON array output
tm1cli logs messages --follow --output json   # NDJSON stream (one object per line)
# Audit log (requires AuditLogOn=T in tm1s.cfg; see below)
tm1cli logs audit                                            # show last 100 audit log entries
tm1cli logs audit --tail 50                                  # show last 50 entries
tm1cli logs audit --since 24h --object-type Cube             # cube events in the past 24 hours
tm1cli logs audit --object-type Process --object-name ImportSales  # specific process events
tm1cli logs audit --user admin --follow                      # stream new entries for a user
tm1cli logs audit --since 2026-04-24T10:00 --until 2026-04-24T18:00 --raw  # time range, raw output
tm1cli logs audit --output json                              # JSON array output
tm1cli logs audit --follow --output json                     # NDJSON stream (one object per line)

Prerequisite: The TM1 server must have audit logging enabled (AuditLogOn=T in tm1s.cfg). When audit logging is disabled, the command exits with a clear error explaining how to enable it.

Note: An empty result set may also indicate insufficient permission to read the audit log on this server.

Levels use canonical TM1 names: Info, Warning, Error, Fatal, Debug, Unknown, Off. Aliases warn and err are also accepted.

Server-side $filter is used for --since and --level. If the server rejects the filter (HTTP 400/501), tm1cli falls back to client-side filtering with a [warn] message.

--since accepts a Go duration (10m, 2h) or an absolute timestamp. Absolute timestamps without a timezone offset are interpreted in your local time zone (matching journalctl --since). Use RFC3339 with an explicit offset (e.g. 2026-04-24T10:00:00+08:00 or 2026-04-24T02:00:00Z) when you need unambiguous UTC.

Export

tm1cli export "Sales" --view "Default"               # print table to screen
tm1cli export "Sales" --view "Default" -o data.csv   # write CSV file
tm1cli export "Sales" --view "Default" -o data.json  # write JSON file
tm1cli export "Sales" --view "Default" -o report.xlsx # write Excel file
tm1cli export "Sales" --view "Default" --output json  # JSON to screen
tm1cli export "Sales" --view "Default" -o data.csv --no-header  # CSV without header

Global Flags

--server <name>   Use a specific connection
--output <format> Output format: table or json
--verbose         Show request details
--version         Print version

Shell Completion

Generate a completion script for your shell. Run tm1cli completion <shell> --help for the install steps.

tm1cli completion bash       # bash
tm1cli completion zsh        # zsh
tm1cli completion fish       # fish
tm1cli completion powershell # PowerShell

Auth Modes

Mode TM1 Security Mode Usage
basic Mode 1 (TM1 native) --auth basic
cam Mode 4/5 (CAM/LDAP) --auth cam --namespace <ns>

Roadmap

  • v0.1.0 — Config, cubes, dims, members, process list/run, export view → table
  • v0.1.1 — Export view → CSV/JSON file
  • v0.1.2 — Bug fixes for export and URL handling
  • v0.2.0 — MDX export, XLSX output, config edit, views, subsets, diagnostics
  • v0.3.0 — Process dump/load, watch mode
  • v0.4.0 — OS keychain password storage, consolidated member indentation, cellset parsing

License

MIT

About

A CLI tool for IBM TM1/Planning Analytics REST API

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages