Use the Studio from the command line to interact with team, projects, and tables.
@tableland/studio-cli package is a developer tool to help you interact with projects created in the Studio web app. You can:
- Login with the account you signed up for in the Studio.
- List team and project information.
- Create new teams, add members, and create new projects.
- Import existing tables into projects.
- Import data (CSV files) from your machine and write the data to project tables.
- Set up contexts to make it easier to execute Studio CLI commands.
You can install the CLI tool globally via
npm install -g @tableland/studio-cli
yarn global add @tableland/studio-cli
pnpm add -g @tableland/studio-cli
You will need a
providerUrl when you first use the Studio CLI, which starts with the
login command. From there, these values will be used thereafter and no longer needed on a per-command basis. The
privateKey should be for the same account you used in the Studio web app, and the other values correspond to the chain you plan on deploying your project to.
Many of the commands make use of CLI-specific data that is not shown in the UI, such as team and project IDs. Thus, there are helpful commands to list (
ls) details that log these IDs for use in subsequent commands.
For many of the examples, the format
<some_text_here> will be used to denote a value passed the developer. For example, in
--private-key <private_key>, some private key
abc123 would then be used as
--private-key abc123. All of the commands start with the login command. We’ll also show examples using tables created on a local network with
@tableland/local running in the background (with chain ID
31337), but in reality, the Studio is available for use on testnet and mainnet chains.
The Studio CLI includes a number of commands that let you interact with your projects. The general command format is as follows:
studio <command> <arguments> [flags]
You can see all of these commands available by either running the
help command or passing the help flag
studio login: Login to the Studio with your account, which creates a login session via a private key. Note: this will create a session file (
.studioclisession.json) in your directory that will store session information.
studio logout: Logout of the Studio, which logs out of the current session.
studio team <subcommand>: Manage your studio teams.
ls [identifier]: Get a list of your teams, or get the teams for a default team ID.
studio project <subcommand>: Manage your studio projects.
ls [team_id]: List the projects for the given ID, or if no id is given, use the default context.
studio use [context] [id]: Use the given context ID for all ensuing commands, where a context is one of:
studio unuse [context]: Remove a context set with
use, where a context is one of:
studio import-table <table> <project> <description> [name]: Import an existing Tableland table into a project with description and (optionally) with a new name/alias, defined only in the Studio.
The Tableland CLI includes a number of global flags.
-h, --help: Show help.
-V, --version: Show version number.
-k, --privateKey <private_key>: Private key string, defaults to an empty string. Note: you'll need this when using the
login command, but once the session is set up, it should be good to go.
-p, --providerUrl <url>: JSON RPC API provider URL (e.g.,
https://eth-mainnet.alchemyapi.io/v2/123abc123a...). Defaults to an empty string
-c, --chain <chain_name>: The EVM chain to target. Defaults to an empty string.
Local (for development mode only)
--pid, --projectId <project_id>: Project ID the command is scoped to. Defaults to an empty string.
--apiUrl <url>: The URL of a Studio application API, which defaults to
https://studio.tableland.xyz (only varies during local development, e.g., with a localhost endpoint). Defaults to an empty string.
--baseUrl <url>: The URL of a Tableland validator. Defaults to an empty string.
--store <path>: Path to file store to use for login session. Defaults to
.studioclisession.json, which gets created when you first use the
--config: Path to JSON config file created by the "standard" Tableland CLI's
init command to create
.tablelandrc.json file. Defaults to an empty string.