Titan Network(EN)
🌟【中文】🌟Official Website
TWS
TWS
  • 👋Welcome to Titan Web Services (TWS)
  • Titan Storage
    • Welcome
    • Quickstart
    • Developer Guides
      • Command Line Interface (CLI)
      • SDK Documentation
        • JS SDK
        • GO SDK
    • How-To Guides
      • Build Examples
      • API Integration
  • Titan container
    • Quick Start Guide
  • Titan PCDN
    • Quick Start Guide
  • Support & Feedback
Powered by GitBook
On this page
  1. Titan Storage
  2. Developer Guides

Command Line Interface (CLI)

PreviousDeveloper GuidesNextSDK Documentation

Last updated 3 months ago

Using the CLI

If you have already completed the steps for and , your CLI and Titan Storage are already configured. To use the CLI, you can follow the steps below:

1. Compile the Command-Line File Using the Go Build Tool

First, ensure that Go is installed in your environment. Use the following command to compile the CLI file:

go build -o cli main.go

This will generate an executable file named cli, which you can use to interact with the API.

2. Initialize Environment Variables

Before using the CLI, you need to set up environment variables using the API key you registered in the browser:

export TITAN_URL=<your_titan_url>
export API_KEY=<your_api_key>
  • TITAN_URL: The URL of the Titan service.

  • API_KEY: The API key you obtained from the Titan platform.

3. Execute CLI Methods

Once the environment variables are set, you can use the CLI to execute API methods. The basic format to execute a command is:

./cli <api_method> <arguments>

Methods

- Generate the autocompletion script for the specified shell

- delete file

- Manage folders

- Generate markdown documentation

- get file

- list files

- upload file

- get file url by cid

- Print the version number

Create Account
Set API Key
completion
delete
folder
gendoc
get
list
upload
url
version