Watch a video walkthrough:
Clone your repository and generate compile_commands.json
. See examples of how this can be generated
here.
Clone your repository and ensure your Go module is properly initialized:
go mod download
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".
Install with pip within a Python virtualenv:
pip install territory
In the directory containing compile_commands.json
run:
territory upload --repo-id $YOUR_REPOSITORY_ID -l c
In your git repository run:
territory upload --repo-id $YOUR_REPOSITORY_ID -l go
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.
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.
- In "Settings" go to to Upload tokens.
- Create a new token and save its text to a file.
- 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