Quickstart
Connecting to LoonFS and writing a file.
Install the CLI
Section titled “Install the CLI”curl -fsSL https://install.loonfs.com | shloonfs versionConnect to LoonFS
Section titled “Connect to LoonFS”The CLI can connect to a LoonFS server or directly to an object storage bucket. Choose one of the following:
Option A: Connect to a server
Section titled “Option A: Connect to a server”Use the server’s HTTPS endpoint and bearer token:
export LOONFS_AUTH_TOKEN="<your-token>"
loonfs --no-input profile create remote default \ --server-url "https://<your-endpoint>"Option B: Connect directly to S3
Section titled “Option B: Connect directly to S3”In embedded mode, the CLI reads and writes directly to the bucket. No LoonFS server is required.
First, follow the S3 configuration guide to create a bucket and configure credentials. Then create a profile:
loonfs --no-input profile create s3 default \ --bucket "<bucket_name>" \ --region "<aws_region>"Create a namespace
Section titled “Create a namespace”A namespace contains the files and folders for the filesystem.
loonfs namespace create demoloonfs use demoWrite and read a file
Section titled “Write and read a file”printf 'Hello from LoonFS\n' | loonfs put - /hello.txtloonfs ls /loonfs cat /hello.txtThe final command prints Hello from LoonFS.
See the CLI reference for more commands, including copying files, viewing revision history, and restoring deleted files.
Finally, a hosted LoonFS server can be used without the CLI via the API or any of the available SDKs.