Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding j1 CLI documentation. #727

Merged
merged 2 commits into from
Jun 1, 2022
Merged

Conversation

adam-in-ict
Copy link
Contributor

Adding documentation for j1 CLI.

Fix for issue #678

@adam-in-ict adam-in-ict requested a review from a team May 27, 2022 20:46
@@ -1526,3 +1526,63 @@ immediately reflect that in the graph.
We hope to provide a good interface via this SDK for providing an interface for
handling events via this SDK and providing commands/utilities for testing events
to get an understanding of how they may affect the JupiterOne graph.

## j1 CLI
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be better to start on line 1490 with the other j1 cli info. Up to you.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, I went back and forth with putting it higher up starting at line 1490. My main reason for leaving it at the bottom is it felt like it was interrupting the j1-integration documentation too much when placed up there.

I'll leave it where it is for now, but we can move it if we start to see its location confusing people.

@adam-in-ict adam-in-ict merged commit ac09751 into main Jun 1, 2022
@adam-in-ict adam-in-ict deleted the INT-3982-add-j1-documentation branch June 1, 2022 20:31

### Authentication

For commands that require interaction with JupiterOne's API, the CLI will
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For commands that require interaction with JupiterOne's API, the CLI
provides two options for providing credentials:

  1. All commands that interact with an API will accept an --api-key option.
  2. For added convenience when developing locally, we will also look for a
    JUPITERONE_API_KEY environment variable to be used as the API key.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually copied this from the Authentication of j1-integration since they work the exact same way, but I agree that your wording is better.

--include-entities Include entities in export (default: true)
--include-relationships Include relationships in export (default: true)
--include-deleted Include deleted entities/relationships in export (default: true)
--no-include-entities Exclude entities in export
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be nice to change --no-include-entities to --exclude-entities one day

```
Usage: j1 import [options]

Imports exported account entities/relationships into JupiterOne account
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any gotchas that we should make the user aware of? For example, what if a _key already exists?


Options:
-d --data-dir <relative_directory> The directory where entities and relationships can be found (default: ".j1/export")
--scope <scope> A unique id that identifies the synchronization job that will be importing your assets, use any id of your choosing.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the default for scope?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No default. It will error if one isn't provided.


Currently, the CLI supports a limited interface consisting of only two commands:
`export` and `import`.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be nice to include the required options?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Required is a bit odd for these, since so many of them either have a default or will use .env values if provided that way.

I think the only option truly flagged as a required one is the scope for the import command. I can get that added in a later PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants