Lagrange Dao
  • Introduction
  • Getting Started
    • Build and push your Docker image
    • How to Use the Test Environment
  • Space
    • Intro
      • Lagrange Definition Language(LDL)
      • Lagrange-cli
    • Create Space
    • Build Space
      • Option 1: Langrange-cli
      • Option 2: Web Interface
    • Fork Space
    • Run Space
    • Space Settings
      • Instance Type
      • Space Hardware
    • Use Case
  • Datasets
    • Data Card
  • Models
  • Case Study
    • Stable Diffusion
      • How to Build Stable Diffusion Space
      • How to Integrate Stable Diffusion via Inference API
    • Diffuser/Transformer
      • How to Integrate Diffuser/Transformer
  • Decentralized Auction Marketplace
    • Auction Engine
    • Bidding Task State Machine
    • Reputation System
  • Security
    • Access Tokens
  • Token
  • Mars Testnet
    • Before You Get Started
    • Computing Provider Setup
    • Building Space
    • Using Space
    • Case Study
    • FAQ
  • API Reference
Powered by GitBook
On this page
  • How to install
  • How to use
  1. Space
  2. Intro

Lagrange-cli

PreviousLagrange Definition Language(LDL)NextCreate Space

Last updated 8 months ago

Lagrange-cli is a distributed version control tool, which means that a local clone of the project is a complete version control space in IPFS.

How to install

Clone and Install lagrange-cli: Clone the lagrange-cli repository and install it using pip:

git clone https://github.com/lagrangedao/lagrange-cli.git
cd lagrange-cli
pip install .

Note: To clone and Install lagrange-cli on the , switch to the new_testnet branch:

git clone https://github.com/lagrangedao/lagrange-cli.git
git checkout origin/new_testnet -b new_testnet
pip install .

How to use

1. Copy Space Link: After creating your space on Lagrange, copy the link. It will look like this: https://lagrangedao.org/<type>/<wallet_address>/<name>.

2. Clone Your Space: Open your terminal and run the following command to clone your space repository:

lag clone <space_link>

Replace <space_link> with the link, you copied in Step 1.

3. Navigate to Folder: Change your directory to the folder created during the clone. Its name matches your space's name:

cd <space_name>

4. Add Code Files: Copy your code files and paste them into the folder (same as your space's name).

5. Add and Commit Files: Inside the cloned repository, add the code files you want to commit:

lag add file1 file2 file3 ...

To add all files in the current directory and subdirectories:

lag add .

Commit the added files with a descriptive message:

lag commit -m "commit message"

6.Configure API Token:

You will be prompted to set your API token. Go to your Lagrange Profile→Settings→Access Tokens, and get your access token.

In your terminal, use the following command to set your API token:

lag config --api-token <your_access_token>

Replace <your_access_token> with the token you obtained in the previous step.

7. Push Changes to Space: Push your committed changes to your own Space using:

lag push <space_link>
testnet