Skip to main content

Client for territory.dev

Project description

Uploading sources with the territory.dev CLI client

Watch a video walkthrough:

YouTube video showing an example of using the client

1. Prepare your repository

For C/C++ Projects

Clone your repository and generate compile_commands.json. See examples of how this can be generated here.

For Go Projects

Clone your repository and ensure your Go module is properly initialized:

go mod download

For Python Projects

If you created a virtualenv for your project, we recommend you install and run territory with it activated.

2. Add a new repo in the territory.dev interface

Go to settings,

find the "Add" button under Repositories,

enter repository details, choose the "Uploaded" option, and select the appropriate language (C/C++ or Go),

create the new repository by clicking "Save".

3. Install the client

Install with pip within a Python virtualenv:

pip install territory

4. Run the upload

For C/C++ Projects

In the directory containing compile_commands.json run:

territory upload --repo-id $YOUR_REPOSITORY_ID -l c

For Go and Python Projects

In your git repository run:

# Go:
territory upload --repo-id $YOUR_REPOSITORY_ID -l go

# Python:
territory upload --repo-id $YOUR_REPOSITORY_ID -l python

We will scan the repo for modules, package parse results and send the code for indexing.

The specific command containing the repository ID can be found in repository settings under "Recent builds".

First time you use the client, we will open the web browser and you will be asked to authenticate the client in the web app.

Once the upload finishes, indexing will start.

Non-interactive authentication

In case you need to run the upload in an environment where the browser authentication flow is not suitable (e.g. a CI build), you can provide the necessary token manually.

  1. In "Settings" go to to Upload tokens.
  2. Create a new token and save its text to a file.
  3. Point the CLI to the file by adding the --upload-token-path, e.g.:
    territory upload \
        --upload-token-path /path/to/token \
        --repo-id $YOUR_REPOSITORY_ID
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

territory-1.5.1.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

territory-1.5.1-py2.py3-none-any.whl (13.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file territory-1.5.1.tar.gz.

File metadata

  • Download URL: territory-1.5.1.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for territory-1.5.1.tar.gz
Algorithm Hash digest
SHA256 c1e89fcbfd015abe8a53c6c7e717f936865cad90d41baca27f4eab2c296a6910
MD5 1b764c286f4631eb655573eb3e3e19d8
BLAKE2b-256 c382575323875d35b3016c4d933b9637233fbbf41b57f385d1455cef6b433efe

See more details on using hashes here.

File details

Details for the file territory-1.5.1-py2.py3-none-any.whl.

File metadata

  • Download URL: territory-1.5.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for territory-1.5.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0e439dba2666de135e0f8e7be5863516c0d5f02d97b5b864ffb908562f065309
MD5 1636d0cab487ead67529d36c47c33644
BLAKE2b-256 bf540db0605e2714a11ae33f6c28220fda878a7e019c7cccf86cc10069860963

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page