Skip to content

Commit edaf473

Browse files
committed
Add documentation for the commands and remove mentions of session
1 parent 95a7d4d commit edaf473

8 files changed

Lines changed: 67 additions & 8 deletions

File tree

docs/_sidebar.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
* [info](/docs/auth/info.md)
1111
* [login](/docs/auth/login.md)
1212
* [logout](/docs/auth/logout.md)
13+
* [context](/docs/context/overview.md)
14+
* [set](/docs/context/set.md)
15+
* [clear](/docs/context/clear.md)
16+
* [info](/docs/context/info.md)
1317
* [api](/docs/api.md)
1418
* [itwin](/docs/itwin/overview.md)
1519
* [create](/docs/itwin/create.md)

docs/context/clear.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# itp context clear
2+
3+
Clear the cached context.
4+
5+
## Examples
6+
7+
```bash
8+
# Example 1: Clear the cached context
9+
itp context clear
10+
```

docs/context/info.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# itp context info
2+
3+
Display the cached context.
4+
5+
## Examples
6+
7+
```bash
8+
# Example 1: Display the cached context
9+
itp context info
10+
```

docs/context/overview.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# itp context
2+
3+
Work with iTwin CLI context.
4+
5+
## Available Commands
6+
7+
- [itp context set](set.md)
8+
- [itp context info](info.md)
9+
- [itp context clear](clear.md)

docs/context/set.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# itp context set
2+
3+
Set a new cached context.
4+
5+
## Options
6+
7+
- **`--imodel-id`**
8+
The ID of the iModel to create a context for.
9+
**Type:** `string` **Required:** No
10+
11+
- **`--itwin-id`**
12+
The ID of the iTwin to create a context for.
13+
**Type:** `string` **Required:** No
14+
15+
## Examples
16+
17+
```bash
18+
# Example 1: Set a new cached context using an iTwin ID
19+
itp context set --itwin-id 12345
20+
21+
# Example 2: Set a new cached context using an iModel ID
22+
itp context set --imodel-id 67890
23+
24+
# Example 3: Error when neither --itwin-id nor --imodel-id is provided
25+
itp context set
26+
```

src/commands/context/clear.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import BaseCommand from "../../extensions/base-command.js";
22

33
export default class ClearContext extends BaseCommand {
4-
static description = "Clear the context of the current session.";
5-
4+
static description = "Clear the cached context.";
5+
66
static examples = [
77
{
88
command: `<%= config.bin %> <%= command.id %>`,
9-
description: 'Example 1: Clear the context of the current session'
9+
description: 'Example 1: Clear the cached context'
1010
}
1111
];
1212

1313
async run() {
1414
this.clearContext();
1515
return this.logAndReturnResult({ result: "Context cleared." });
1616
}
17-
}
17+
}

src/commands/context/info.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import BaseCommand from "../../extensions/base-command.js";
22

33
export default class InfoContext extends BaseCommand {
4-
static description = "Display the current context of the session.";
4+
static description = "Display the cached context.";
55

66
static examples = [
77
{
88
command: `<%= config.bin %> <%= command.id %>`,
9-
description: 'Example 1: Display the current context of the session'
9+
description: 'Example 1: Display the cached context'
1010
}
1111
];
1212

src/commands/context/set.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import { Flags } from "@oclif/core";
55
import BaseCommand from "../../extensions/base-command.js";
66

77
export default class SetContext extends BaseCommand {
8-
static description = "Create a new context for the current session.";
8+
static description = "Set a new cached context.";
99

1010
static examples = [
1111
{
1212
command: `<%= config.bin %> <%= command.id %>`,
13-
description: 'Example 1: Create a new context for the current session'
13+
description: 'Example 1: Set a new cached context'
1414
}
1515
];
1616

0 commit comments

Comments
 (0)