@simplysf/simply-gitlab 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1203 -0
- package/bin/run.js +9 -0
- package/lib/commands/gitlab/branch/create.d.ts +14 -0
- package/lib/commands/gitlab/branch/create.js +50 -0
- package/lib/commands/gitlab/branch/create.js.map +1 -0
- package/lib/commands/gitlab/branch/list.d.ts +12 -0
- package/lib/commands/gitlab/branch/list.js +45 -0
- package/lib/commands/gitlab/branch/list.js.map +1 -0
- package/lib/commands/gitlab/ci/environment/list.d.ts +14 -0
- package/lib/commands/gitlab/ci/environment/list.js +47 -0
- package/lib/commands/gitlab/ci/environment/list.js.map +1 -0
- package/lib/commands/gitlab/ci/job/list.d.ts +12 -0
- package/lib/commands/gitlab/ci/job/list.js +55 -0
- package/lib/commands/gitlab/ci/job/list.js.map +1 -0
- package/lib/commands/gitlab/ci/job/log.d.ts +12 -0
- package/lib/commands/gitlab/ci/job/log.js +54 -0
- package/lib/commands/gitlab/ci/job/log.js.map +1 -0
- package/lib/commands/gitlab/ci/variable/list.d.ts +12 -0
- package/lib/commands/gitlab/ci/variable/list.js +56 -0
- package/lib/commands/gitlab/ci/variable/list.js.map +1 -0
- package/lib/commands/gitlab/commit/create.d.ts +22 -0
- package/lib/commands/gitlab/commit/create.js +74 -0
- package/lib/commands/gitlab/commit/create.js.map +1 -0
- package/lib/commands/gitlab/commit/diff.d.ts +12 -0
- package/lib/commands/gitlab/commit/diff.js +61 -0
- package/lib/commands/gitlab/commit/diff.js.map +1 -0
- package/lib/commands/gitlab/commit/list.d.ts +17 -0
- package/lib/commands/gitlab/commit/list.js +58 -0
- package/lib/commands/gitlab/commit/list.js.map +1 -0
- package/lib/commands/gitlab/commit/view.d.ts +11 -0
- package/lib/commands/gitlab/commit/view.js +52 -0
- package/lib/commands/gitlab/commit/view.js.map +1 -0
- package/lib/commands/gitlab/file/create.d.ts +20 -0
- package/lib/commands/gitlab/file/create.js +65 -0
- package/lib/commands/gitlab/file/create.js.map +1 -0
- package/lib/commands/gitlab/file/update.d.ts +21 -0
- package/lib/commands/gitlab/file/update.js +67 -0
- package/lib/commands/gitlab/file/update.js.map +1 -0
- package/lib/commands/gitlab/file/view.d.ts +13 -0
- package/lib/commands/gitlab/file/view.js +59 -0
- package/lib/commands/gitlab/file/view.js.map +1 -0
- package/lib/commands/gitlab/mr/create.d.ts +25 -0
- package/lib/commands/gitlab/mr/create.js +77 -0
- package/lib/commands/gitlab/mr/create.js.map +1 -0
- package/lib/commands/gitlab/mr/list.d.ts +18 -0
- package/lib/commands/gitlab/mr/list.js +64 -0
- package/lib/commands/gitlab/mr/list.js.map +1 -0
- package/lib/commands/gitlab/mr/update.d.ts +25 -0
- package/lib/commands/gitlab/mr/update.js +82 -0
- package/lib/commands/gitlab/mr/update.js.map +1 -0
- package/lib/commands/gitlab/mr/view.d.ts +11 -0
- package/lib/commands/gitlab/mr/view.js +54 -0
- package/lib/commands/gitlab/mr/view.js.map +1 -0
- package/lib/commands/gitlab/project/list.d.ts +14 -0
- package/lib/commands/gitlab/project/list.js +56 -0
- package/lib/commands/gitlab/project/list.js.map +1 -0
- package/lib/commands/gitlab/project/view.d.ts +10 -0
- package/lib/commands/gitlab/project/view.js +45 -0
- package/lib/commands/gitlab/project/view.js.map +1 -0
- package/lib/commands/gitlab/release/list.d.ts +11 -0
- package/lib/commands/gitlab/release/list.js +43 -0
- package/lib/commands/gitlab/release/list.js.map +1 -0
- package/lib/commands/gitlab/search.d.ts +14 -0
- package/lib/commands/gitlab/search.js +68 -0
- package/lib/commands/gitlab/search.js.map +1 -0
- package/lib/commands/gitlab/tag/list.d.ts +14 -0
- package/lib/commands/gitlab/tag/list.js +50 -0
- package/lib/commands/gitlab/tag/list.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +22 -0
- package/lib/index.js.map +1 -0
- package/lib/shared/base-command.d.ts +91 -0
- package/lib/shared/base-command.js +242 -0
- package/lib/shared/base-command.js.map +1 -0
- package/package.json +243 -0
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AuthError, CliError, ConfigError, GitLabClient, HttpError, NetworkError, resolveGitLabConfig, type ConfigOverrides, type EnvLike, type GitLabConfig, type ListResult, type ProjectRef, } from '@simplysf/simply-gitlab-core';
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, SimplySF.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
// This package is a CLI first (see bin/run.js). The library surface lives in
|
|
17
|
+
// `@simplysf/simply-gitlab-core`; these re-exports exist so a consumer that installed the CLI can
|
|
18
|
+
// reach the client without a second dependency, and so the two packages cannot drift on the names
|
|
19
|
+
// they use for the same thing. New code should import the core package directly, which is where
|
|
20
|
+
// anything added from here on will appear.
|
|
21
|
+
export { AuthError, CliError, ConfigError, GitLabClient, HttpError, NetworkError, resolveGitLabConfig, } from '@simplysf/simply-gitlab-core';
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,6EAA6E;AAC7E,kGAAkG;AAClG,kGAAkG;AAClG,gGAAgG;AAChG,2CAA2C;AAC3C,OAAO,EACL,SAAS,EACT,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,mBAAmB,GAMpB,MAAM,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { Command, type Interfaces } from '@oclif/core';
|
|
2
|
+
import { GitLabClient, type GitLabConfig } from '@simplysf/simply-gitlab-core';
|
|
3
|
+
/**
|
|
4
|
+
* Splits a comma-separated flag value, dropping blanks. `--labels ''` and `--labels 'a,'` would
|
|
5
|
+
* otherwise yield an empty label, which GitLab stores as one.
|
|
6
|
+
*/
|
|
7
|
+
export declare function parseList(value: string | undefined): string[] | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* Flags every write command shares, defined once so the wording cannot drift between them.
|
|
10
|
+
*
|
|
11
|
+
* There is no `--confirm` here, because no command in this CLI destroys anything yet — every
|
|
12
|
+
* write either creates something or edits a merge request, and both are recoverable. Requiring
|
|
13
|
+
* a confirmation for those would train a caller to pass it always, at which point it protects
|
|
14
|
+
* nothing while still implying that it does. The first command that deletes a branch, a tag, or
|
|
15
|
+
* a file is the one that brings the flag back.
|
|
16
|
+
*/
|
|
17
|
+
export declare const writeFlags: {
|
|
18
|
+
'dry-run': Interfaces.BooleanFlag<boolean>;
|
|
19
|
+
};
|
|
20
|
+
/** The project selector, on every command that is scoped to one. */
|
|
21
|
+
export declare const projectFlag: {
|
|
22
|
+
project: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
|
|
23
|
+
};
|
|
24
|
+
/** The paging ceiling, worded once so every list command reads the same. */
|
|
25
|
+
export declare function limitFlag(fallback: number, what: string): {
|
|
26
|
+
limit: Interfaces.OptionFlag<number>;
|
|
27
|
+
};
|
|
28
|
+
declare const gitlabFlags: {
|
|
29
|
+
'gitlab-url': Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
|
|
30
|
+
'gitlab-token': Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
|
|
31
|
+
'env-file': Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
|
|
32
|
+
};
|
|
33
|
+
export type GitLabFlags<T extends typeof Command> = Interfaces.InferredFlags<typeof gitlabFlags & T['flags']>;
|
|
34
|
+
export type CommandArgs<T extends typeof Command> = Interfaces.InferredArgs<T['args']>;
|
|
35
|
+
/**
|
|
36
|
+
* Everything every command shares: `--json` (oclif prints whatever `run()` returns, verbatim),
|
|
37
|
+
* the `--gitlab-*` connection flags, `--env-file` loading, and turning failures into stable exit
|
|
38
|
+
* codes without letting anything reach stdout.
|
|
39
|
+
*
|
|
40
|
+
* GitLab is one product with one API, so unlike the Atlassian CLI this repo is modelled on there
|
|
41
|
+
* is no second base class per product — the connection flags live here directly.
|
|
42
|
+
*/
|
|
43
|
+
export declare abstract class GitLabCommand<T extends typeof Command> extends Command {
|
|
44
|
+
static enableJsonFlag: boolean;
|
|
45
|
+
static baseFlags: {
|
|
46
|
+
'gitlab-url': Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
|
|
47
|
+
'gitlab-token': Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
|
|
48
|
+
'env-file': Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Set by any command that changes data. The read-only guard is then enforced centrally in
|
|
52
|
+
* `init()`, so a future write command cannot forget to call it — which is exactly the kind
|
|
53
|
+
* of omission that would go unnoticed until it mattered.
|
|
54
|
+
*/
|
|
55
|
+
static isWrite: boolean;
|
|
56
|
+
protected args: CommandArgs<T>;
|
|
57
|
+
protected rawFlags: Record<string, unknown>;
|
|
58
|
+
protected get flags(): GitLabFlags<T>;
|
|
59
|
+
init(): Promise<void>;
|
|
60
|
+
protected gitlab(): GitLabClient;
|
|
61
|
+
/** Explicit flags outrank the environment, which outranks the `--env-file` contents. */
|
|
62
|
+
protected gitlabConfig(): GitLabConfig;
|
|
63
|
+
/**
|
|
64
|
+
* Turns any failure into one compact, machine-readable line on stderr plus a stable exit
|
|
65
|
+
* code, and never lets a failure reach stdout.
|
|
66
|
+
*
|
|
67
|
+
* This has to cover *every* error, not just this CLI's own: oclif's default `--json` error
|
|
68
|
+
* path serializes its whole parse context — including the raw argv, and therefore any token
|
|
69
|
+
* passed as a flag — to stdout. For a caller that captures stdout into an AI agent's
|
|
70
|
+
* context, that is a credential disclosure, so the default path is never taken here.
|
|
71
|
+
*
|
|
72
|
+
* Exit codes stay identical with and without `--json`: 2 config or usage, 3 auth, 1
|
|
73
|
+
* everything else.
|
|
74
|
+
*/
|
|
75
|
+
protected catch(error: Interfaces.CommandError): Promise<unknown>;
|
|
76
|
+
/**
|
|
77
|
+
* Logs a line that contains server-supplied text. Everything the instance chose is stripped of
|
|
78
|
+
* control characters first — the same treatment error output gets, and for the same reason:
|
|
79
|
+
* this stream is parsed by an agent, and a bare escape sequence can make what a person sees
|
|
80
|
+
* differ from what the agent ingests.
|
|
81
|
+
*
|
|
82
|
+
* Repository file contents and job traces come through here too. Those are the widest input of
|
|
83
|
+
* all: anyone who can open a merge request controls them.
|
|
84
|
+
*/
|
|
85
|
+
protected logSafe(message: string): void;
|
|
86
|
+
/** Renders a list result and says plainly whether the limit cut it short. */
|
|
87
|
+
protected reportList(count: number, total: number | undefined, complete: boolean, limit: number, what: string): void;
|
|
88
|
+
/** Narrowed accessor so subclasses read flags without casting at every use. */
|
|
89
|
+
protected flagValue(name: string): string | undefined;
|
|
90
|
+
}
|
|
91
|
+
export {};
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, SimplySF.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import process from 'node:process';
|
|
17
|
+
import { Command, Flags } from '@oclif/core';
|
|
18
|
+
import { assertWritesAllowed, AuthError, CliError, collectSecrets, GitLabClient, HttpError, loadEnvFile, redactSecrets, resolveGitLabConfig, sanitiseDeep, SECRET_ENV, stripControl, } from '@simplysf/simply-gitlab-core';
|
|
19
|
+
/**
|
|
20
|
+
* Splits a comma-separated flag value, dropping blanks. `--labels ''` and `--labels 'a,'` would
|
|
21
|
+
* otherwise yield an empty label, which GitLab stores as one.
|
|
22
|
+
*/
|
|
23
|
+
export function parseList(value) {
|
|
24
|
+
if (value === undefined)
|
|
25
|
+
return undefined;
|
|
26
|
+
const items = value
|
|
27
|
+
.split(',')
|
|
28
|
+
.map((item) => item.trim())
|
|
29
|
+
.filter((item) => item !== '');
|
|
30
|
+
return items.length === 0 ? undefined : items;
|
|
31
|
+
}
|
|
32
|
+
/** Credential flags, used both to declare them and to scrub their values out of any output. */
|
|
33
|
+
const SECRET_FLAGS = new Set(['gitlab-token']);
|
|
34
|
+
/**
|
|
35
|
+
* Every credential that could otherwise ride along in an error message. Values are collected
|
|
36
|
+
* from the process arguments and environment rather than parsed flags, because the errors most
|
|
37
|
+
* likely to echo an argument are the ones thrown before parsing finishes. The redaction itself
|
|
38
|
+
* is the core package's, shared with the MCP server; only the argv half is this CLI's.
|
|
39
|
+
*/
|
|
40
|
+
function secrets() {
|
|
41
|
+
const values = [];
|
|
42
|
+
const argv = process.argv;
|
|
43
|
+
for (const [index, arg] of argv.entries()) {
|
|
44
|
+
if (arg.startsWith('--') && SECRET_FLAGS.has(arg.slice(2)))
|
|
45
|
+
values.push(argv[index + 1]);
|
|
46
|
+
const inline = /^--([a-z-]+)=(.+)$/.exec(arg);
|
|
47
|
+
if (inline?.[1] !== undefined && SECRET_FLAGS.has(inline[1]))
|
|
48
|
+
values.push(inline[2]);
|
|
49
|
+
}
|
|
50
|
+
for (const name of SECRET_ENV)
|
|
51
|
+
values.push(process.env[name]);
|
|
52
|
+
return collectSecrets(values);
|
|
53
|
+
}
|
|
54
|
+
/** Names the failure for a machine reader: our own errors keep their class name. */
|
|
55
|
+
function errorName(error, oclifExit) {
|
|
56
|
+
if (error instanceof CliError)
|
|
57
|
+
return error.name;
|
|
58
|
+
return oclifExit === undefined ? 'Error' : 'UsageError';
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Flags every write command shares, defined once so the wording cannot drift between them.
|
|
62
|
+
*
|
|
63
|
+
* There is no `--confirm` here, because no command in this CLI destroys anything yet — every
|
|
64
|
+
* write either creates something or edits a merge request, and both are recoverable. Requiring
|
|
65
|
+
* a confirmation for those would train a caller to pass it always, at which point it protects
|
|
66
|
+
* nothing while still implying that it does. The first command that deletes a branch, a tag, or
|
|
67
|
+
* a file is the one that brings the flag back.
|
|
68
|
+
*/
|
|
69
|
+
export const writeFlags = {
|
|
70
|
+
'dry-run': Flags.boolean({
|
|
71
|
+
summary: 'Print the request that would be sent and exit without sending it.',
|
|
72
|
+
default: false,
|
|
73
|
+
}),
|
|
74
|
+
};
|
|
75
|
+
/** The project selector, on every command that is scoped to one. */
|
|
76
|
+
export const projectFlag = {
|
|
77
|
+
project: Flags.string({
|
|
78
|
+
char: 'p',
|
|
79
|
+
summary: 'Project id, or its full path such as group/subgroup/project.',
|
|
80
|
+
required: true,
|
|
81
|
+
env: 'GITLAB_PROJECT',
|
|
82
|
+
}),
|
|
83
|
+
};
|
|
84
|
+
/** The paging ceiling, worded once so every list command reads the same. */
|
|
85
|
+
export function limitFlag(fallback, what) {
|
|
86
|
+
return {
|
|
87
|
+
limit: Flags.integer({
|
|
88
|
+
summary: `Maximum number of ${what} to return across all pages.`,
|
|
89
|
+
default: fallback,
|
|
90
|
+
min: 1,
|
|
91
|
+
}),
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
const envFileFlag = {
|
|
95
|
+
'env-file': Flags.string({
|
|
96
|
+
char: 'e',
|
|
97
|
+
summary: 'Path to a .env file holding connection settings.',
|
|
98
|
+
description: 'Loaded before anything else. Variables already present in the environment win, so the ' +
|
|
99
|
+
'file never overrides an explicit export, and only GitLab connection variables are read ' +
|
|
100
|
+
'from it. A path that cannot be read is an error.',
|
|
101
|
+
helpGroup: 'CONNECTION',
|
|
102
|
+
}),
|
|
103
|
+
};
|
|
104
|
+
const gitlabFlags = {
|
|
105
|
+
...envFileFlag,
|
|
106
|
+
'gitlab-url': Flags.string({
|
|
107
|
+
summary: 'Base URL of the GitLab instance. Defaults to https://gitlab.com.',
|
|
108
|
+
env: 'GITLAB_URL',
|
|
109
|
+
helpGroup: 'CONNECTION',
|
|
110
|
+
}),
|
|
111
|
+
'gitlab-token': Flags.string({
|
|
112
|
+
summary: 'Personal, project, or group access token.',
|
|
113
|
+
env: 'GITLAB_TOKEN',
|
|
114
|
+
helpGroup: 'CONNECTION',
|
|
115
|
+
}),
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* Everything every command shares: `--json` (oclif prints whatever `run()` returns, verbatim),
|
|
119
|
+
* the `--gitlab-*` connection flags, `--env-file` loading, and turning failures into stable exit
|
|
120
|
+
* codes without letting anything reach stdout.
|
|
121
|
+
*
|
|
122
|
+
* GitLab is one product with one API, so unlike the Atlassian CLI this repo is modelled on there
|
|
123
|
+
* is no second base class per product — the connection flags live here directly.
|
|
124
|
+
*/
|
|
125
|
+
export class GitLabCommand extends Command {
|
|
126
|
+
static enableJsonFlag = true;
|
|
127
|
+
static baseFlags = gitlabFlags;
|
|
128
|
+
/**
|
|
129
|
+
* Set by any command that changes data. The read-only guard is then enforced centrally in
|
|
130
|
+
* `init()`, so a future write command cannot forget to call it — which is exactly the kind
|
|
131
|
+
* of omission that would go unnoticed until it mattered.
|
|
132
|
+
*/
|
|
133
|
+
static isWrite = false;
|
|
134
|
+
args;
|
|
135
|
+
rawFlags = {};
|
|
136
|
+
get flags() {
|
|
137
|
+
return this.rawFlags;
|
|
138
|
+
}
|
|
139
|
+
async init() {
|
|
140
|
+
await super.init();
|
|
141
|
+
const { args, flags } = await this.parse({
|
|
142
|
+
baseFlags: this.constructor.baseFlags,
|
|
143
|
+
flags: this.ctor.flags,
|
|
144
|
+
enableJsonFlag: this.ctor.enableJsonFlag,
|
|
145
|
+
args: this.ctor.args,
|
|
146
|
+
strict: this.ctor.strict,
|
|
147
|
+
});
|
|
148
|
+
this.args = args;
|
|
149
|
+
this.rawFlags = flags;
|
|
150
|
+
// Applied here, before anything reads configuration, so every later lookup sees the file.
|
|
151
|
+
const envFile = this.rawFlags['env-file'];
|
|
152
|
+
if (typeof envFile === 'string')
|
|
153
|
+
loadEnvFile(envFile);
|
|
154
|
+
// After the env file, so a read-only guard carried in a credential file is honoured, and
|
|
155
|
+
// before run(), so no write command can issue a request first.
|
|
156
|
+
if (this.constructor.isWrite)
|
|
157
|
+
assertWritesAllowed();
|
|
158
|
+
}
|
|
159
|
+
gitlab() {
|
|
160
|
+
return new GitLabClient(this.gitlabConfig());
|
|
161
|
+
}
|
|
162
|
+
/** Explicit flags outrank the environment, which outranks the `--env-file` contents. */
|
|
163
|
+
gitlabConfig() {
|
|
164
|
+
const overrides = {
|
|
165
|
+
url: this.flagValue('gitlab-url'),
|
|
166
|
+
token: this.flagValue('gitlab-token'),
|
|
167
|
+
};
|
|
168
|
+
return resolveGitLabConfig(overrides);
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Turns any failure into one compact, machine-readable line on stderr plus a stable exit
|
|
172
|
+
* code, and never lets a failure reach stdout.
|
|
173
|
+
*
|
|
174
|
+
* This has to cover *every* error, not just this CLI's own: oclif's default `--json` error
|
|
175
|
+
* path serializes its whole parse context — including the raw argv, and therefore any token
|
|
176
|
+
* passed as a flag — to stdout. For a caller that captures stdout into an AI agent's
|
|
177
|
+
* context, that is a credential disclosure, so the default path is never taken here.
|
|
178
|
+
*
|
|
179
|
+
* Exit codes stay identical with and without `--json`: 2 config or usage, 3 auth, 1
|
|
180
|
+
* everything else.
|
|
181
|
+
*/
|
|
182
|
+
async catch(error) {
|
|
183
|
+
// oclif attaches its own exit code to usage errors; reuse it so --json and plain runs agree.
|
|
184
|
+
const oclifExit = error.oclif?.exit;
|
|
185
|
+
const exitCode = error instanceof CliError ? error.exitCode : (oclifExit ?? 1);
|
|
186
|
+
// Error text can quote a server response body, which is as attacker-influenced as any other
|
|
187
|
+
// field the instance returns. Control-stripped but NOT collapsed to one line: newlines here
|
|
188
|
+
// are this CLI's own. Server-supplied text is made single-line where it is interpolated
|
|
189
|
+
// instead — see `formatSnippet` in core/http.ts.
|
|
190
|
+
const redact = secrets();
|
|
191
|
+
const message = stripControl(redactSecrets(error.message, redact));
|
|
192
|
+
if (this.jsonEnabled()) {
|
|
193
|
+
// Written straight to the stream: oclif silences this.log/logToStderr under --json.
|
|
194
|
+
process.stderr.write(`${JSON.stringify({
|
|
195
|
+
error: {
|
|
196
|
+
name: errorName(error, oclifExit),
|
|
197
|
+
message,
|
|
198
|
+
exitCode,
|
|
199
|
+
...(error instanceof HttpError ? { status: error.status, body: sanitiseDeep(error.body, redact) } : {}),
|
|
200
|
+
...(error instanceof AuthError ? { status: error.status } : {}),
|
|
201
|
+
},
|
|
202
|
+
})}\n`);
|
|
203
|
+
this.exit(exitCode);
|
|
204
|
+
}
|
|
205
|
+
if (error instanceof CliError) {
|
|
206
|
+
this.error(message, { exit: exitCode, code: error.name });
|
|
207
|
+
}
|
|
208
|
+
// An unexpected error — a TypeError from a malformed payload, say — would otherwise reach
|
|
209
|
+
// oclif's default handler carrying the original, unsanitised and unredacted text. Rethrow
|
|
210
|
+
// the sanitised message instead, preserving the exit code oclif attached.
|
|
211
|
+
const sanitised = new Error(message);
|
|
212
|
+
Object.assign(sanitised, { oclif: { exit: exitCode } });
|
|
213
|
+
return super.catch(sanitised);
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Logs a line that contains server-supplied text. Everything the instance chose is stripped of
|
|
217
|
+
* control characters first — the same treatment error output gets, and for the same reason:
|
|
218
|
+
* this stream is parsed by an agent, and a bare escape sequence can make what a person sees
|
|
219
|
+
* differ from what the agent ingests.
|
|
220
|
+
*
|
|
221
|
+
* Repository file contents and job traces come through here too. Those are the widest input of
|
|
222
|
+
* all: anyone who can open a merge request controls them.
|
|
223
|
+
*/
|
|
224
|
+
logSafe(message) {
|
|
225
|
+
// Redacted as well as stripped. `--body-file` reads any readable path and `--dry-run` prints
|
|
226
|
+
// what would be sent, so a caller who points it at a `.env` by mistake would otherwise put a
|
|
227
|
+
// live token on stdout — and, without --dry-run, into a commit other people fetch.
|
|
228
|
+
this.log(stripControl(redactSecrets(message, secrets())));
|
|
229
|
+
}
|
|
230
|
+
/** Renders a list result and says plainly whether the limit cut it short. */
|
|
231
|
+
reportList(count, total, complete, limit, what) {
|
|
232
|
+
const scope = total === undefined ? '' : ` of ${total}`;
|
|
233
|
+
const note = complete ? '' : ` (limit ${limit} reached; more available)`;
|
|
234
|
+
this.log(`\nShowing ${count}${scope} ${what}${note}.`);
|
|
235
|
+
}
|
|
236
|
+
/** Narrowed accessor so subclasses read flags without casting at every use. */
|
|
237
|
+
flagValue(name) {
|
|
238
|
+
const value = this.rawFlags[name];
|
|
239
|
+
return typeof value === 'string' ? value : undefined;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
//# sourceMappingURL=base-command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-command.js","sourceRoot":"","sources":["../../src/shared/base-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAmB,MAAM,aAAa,CAAC;AAC9D,OAAO,E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AE,KAAa,EAAE,IAAY;QAC3G,MAAM,KAAK,GAAG,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,EAAE,CAAC;QACxD,MAAM,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,KAAK,2BAA2B,CAAC;QACzE,IAAI,CAAC,GAAG,CAAC,aAAa,KAAK,GAAG,KAAK,IAAI,IAAI,GAAG,IAAI,GAAG,CAAC,CAAC;IACzD,CAAC;IAED,+EAA+E;IACrE,SAAS,CAAC,IAAY;QAC9B,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAClC,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;IACvD,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@simplysf/simply-gitlab",
|
|
3
|
+
"description": "Command-line interface for working with GitLab",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"author": "@ClayChipps",
|
|
6
|
+
"homepage": "https://github.com/SimplySF/simply-gitlab",
|
|
7
|
+
"bugs": "https://github.com/SimplySF/simply-gitlab/issues",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/SimplySF/simply-gitlab",
|
|
11
|
+
"directory": "packages/simply-gitlab"
|
|
12
|
+
},
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=22.0.0"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"/lib",
|
|
18
|
+
"/oclif.lock",
|
|
19
|
+
"/oclif.manifest.json"
|
|
20
|
+
],
|
|
21
|
+
"keywords": [
|
|
22
|
+
"oclif",
|
|
23
|
+
"gitlab",
|
|
24
|
+
"ci",
|
|
25
|
+
"merge-requests",
|
|
26
|
+
"simply"
|
|
27
|
+
],
|
|
28
|
+
"license": "Apache-2.0",
|
|
29
|
+
"exports": "./lib/index.js",
|
|
30
|
+
"type": "module",
|
|
31
|
+
"types": "./lib/index.d.ts",
|
|
32
|
+
"bin": {
|
|
33
|
+
"simply": "./bin/run.js"
|
|
34
|
+
},
|
|
35
|
+
"oclif": {
|
|
36
|
+
"additionalVersionFlags": [
|
|
37
|
+
"-v"
|
|
38
|
+
],
|
|
39
|
+
"additionalHelpFlags": [
|
|
40
|
+
"-h"
|
|
41
|
+
],
|
|
42
|
+
"bin": "simply",
|
|
43
|
+
"commands": "./lib/commands",
|
|
44
|
+
"devPlugins": [
|
|
45
|
+
"@oclif/plugin-command-snapshot"
|
|
46
|
+
],
|
|
47
|
+
"flexibleTaxonomy": true,
|
|
48
|
+
"plugins": [],
|
|
49
|
+
"repositoryPrefix": "<%- repo %>/blob/@simplysf/simply-gitlab@<%- version %>/packages/simply-gitlab/<%- commandPath %>",
|
|
50
|
+
"topicSeparator": " ",
|
|
51
|
+
"topics": {
|
|
52
|
+
"gitlab": {
|
|
53
|
+
"description": "Work with GitLab."
|
|
54
|
+
},
|
|
55
|
+
"gitlab:project": {
|
|
56
|
+
"description": "Read project metadata."
|
|
57
|
+
},
|
|
58
|
+
"gitlab:file": {
|
|
59
|
+
"description": "Read and write repository files."
|
|
60
|
+
},
|
|
61
|
+
"gitlab:branch": {
|
|
62
|
+
"description": "List and create branches."
|
|
63
|
+
},
|
|
64
|
+
"gitlab:commit": {
|
|
65
|
+
"description": "Read history and commit changes."
|
|
66
|
+
},
|
|
67
|
+
"gitlab:mr": {
|
|
68
|
+
"description": "Read and manage merge requests."
|
|
69
|
+
},
|
|
70
|
+
"gitlab:tag": {
|
|
71
|
+
"description": "List repository tags."
|
|
72
|
+
},
|
|
73
|
+
"gitlab:release": {
|
|
74
|
+
"description": "List releases."
|
|
75
|
+
},
|
|
76
|
+
"gitlab:ci": {
|
|
77
|
+
"description": "Inspect CI/CD jobs, variables, and environments."
|
|
78
|
+
},
|
|
79
|
+
"gitlab:ci:job": {
|
|
80
|
+
"description": "List CI jobs and read their logs."
|
|
81
|
+
},
|
|
82
|
+
"gitlab:ci:variable": {
|
|
83
|
+
"description": "List CI/CD variables."
|
|
84
|
+
},
|
|
85
|
+
"gitlab:ci:environment": {
|
|
86
|
+
"description": "List deployment environments."
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"dependencies": {
|
|
91
|
+
"@oclif/core": "^4.11.2",
|
|
92
|
+
"@simplysf/simply-gitlab-core": "workspace:^0.1.0"
|
|
93
|
+
},
|
|
94
|
+
"devDependencies": {
|
|
95
|
+
"@oclif/plugin-command-snapshot": "^5.4.0",
|
|
96
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
97
|
+
"vitest": "^4.1.10"
|
|
98
|
+
},
|
|
99
|
+
"publishConfig": {
|
|
100
|
+
"access": "public"
|
|
101
|
+
},
|
|
102
|
+
"scripts": {
|
|
103
|
+
"build": "wireit",
|
|
104
|
+
"compile": "wireit",
|
|
105
|
+
"fix-license": "eslint src test --fix --rule \"header/header: [2]\"",
|
|
106
|
+
"format": "wireit",
|
|
107
|
+
"lint": "wireit",
|
|
108
|
+
"readme": "oclif readme --no-aliases",
|
|
109
|
+
"test": "wireit",
|
|
110
|
+
"test:coverage": "wireit",
|
|
111
|
+
"test:only": "wireit",
|
|
112
|
+
"test:watch": "wireit"
|
|
113
|
+
},
|
|
114
|
+
"wireit": {
|
|
115
|
+
"build": {
|
|
116
|
+
"dependencies": [
|
|
117
|
+
"command-snapshot",
|
|
118
|
+
"compile",
|
|
119
|
+
"lint"
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
"compile": {
|
|
123
|
+
"command": "tsc -p . --pretty --incremental",
|
|
124
|
+
"files": [
|
|
125
|
+
"src/**/*.ts",
|
|
126
|
+
"**/tsconfig.json",
|
|
127
|
+
"../../tsconfig.json"
|
|
128
|
+
],
|
|
129
|
+
"output": [
|
|
130
|
+
"lib/**",
|
|
131
|
+
"*.tsbuildinfo"
|
|
132
|
+
],
|
|
133
|
+
"clean": "if-file-deleted",
|
|
134
|
+
"dependencies": [
|
|
135
|
+
"../simply-gitlab-core:compile"
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
"format": {
|
|
139
|
+
"command": "prettier --write \"+(src|test)/**/*.+(ts|js|json)|command-snapshot.json\"",
|
|
140
|
+
"files": [
|
|
141
|
+
"src/**/*.ts",
|
|
142
|
+
"test/**/*.ts",
|
|
143
|
+
"command-snapshot.json",
|
|
144
|
+
".prettier*"
|
|
145
|
+
],
|
|
146
|
+
"output": []
|
|
147
|
+
},
|
|
148
|
+
"lint": {
|
|
149
|
+
"command": "eslint src test --color --cache --cache-location .eslintcache",
|
|
150
|
+
"files": [
|
|
151
|
+
"src/**/*.ts",
|
|
152
|
+
"test/**/*.ts",
|
|
153
|
+
"**/.eslint*",
|
|
154
|
+
"**/tsconfig.json",
|
|
155
|
+
"../../eslint.config.mjs",
|
|
156
|
+
"../../tsconfig.json"
|
|
157
|
+
],
|
|
158
|
+
"output": [],
|
|
159
|
+
"dependencies": [
|
|
160
|
+
"../simply-gitlab-core:compile"
|
|
161
|
+
]
|
|
162
|
+
},
|
|
163
|
+
"test": {
|
|
164
|
+
"dependencies": [
|
|
165
|
+
"test:compile",
|
|
166
|
+
"test:only",
|
|
167
|
+
"lint"
|
|
168
|
+
]
|
|
169
|
+
},
|
|
170
|
+
"command-snapshot": {
|
|
171
|
+
"command": "node --loader ts-node/esm --no-warnings=ExperimentalWarning \"./bin/dev.js\" snapshot:generate && prettier --write command-snapshot.json",
|
|
172
|
+
"files": [
|
|
173
|
+
"src/**/*.ts"
|
|
174
|
+
],
|
|
175
|
+
"output": [
|
|
176
|
+
"command-snapshot.json"
|
|
177
|
+
],
|
|
178
|
+
"dependencies": [
|
|
179
|
+
"compile"
|
|
180
|
+
]
|
|
181
|
+
},
|
|
182
|
+
"test:compile": {
|
|
183
|
+
"command": "tsc -p \"./test\" --pretty",
|
|
184
|
+
"files": [
|
|
185
|
+
"test/**/*.ts",
|
|
186
|
+
"**/tsconfig.json",
|
|
187
|
+
"../../tsconfig.json"
|
|
188
|
+
],
|
|
189
|
+
"output": [],
|
|
190
|
+
"dependencies": [
|
|
191
|
+
"../simply-gitlab-core:compile"
|
|
192
|
+
]
|
|
193
|
+
},
|
|
194
|
+
"test:only": {
|
|
195
|
+
"command": "vitest run --project simply-gitlab",
|
|
196
|
+
"env": {
|
|
197
|
+
"FORCE_COLOR": "2"
|
|
198
|
+
},
|
|
199
|
+
"files": [
|
|
200
|
+
"test/**/*.ts",
|
|
201
|
+
"src/**/*.ts",
|
|
202
|
+
"**/tsconfig.json",
|
|
203
|
+
"../../tsconfig.json",
|
|
204
|
+
"vitest.config.ts",
|
|
205
|
+
"!*.nut.ts"
|
|
206
|
+
],
|
|
207
|
+
"output": [],
|
|
208
|
+
"dependencies": [
|
|
209
|
+
"../simply-gitlab-core:compile"
|
|
210
|
+
]
|
|
211
|
+
},
|
|
212
|
+
"test:coverage": {
|
|
213
|
+
"command": "vitest run --coverage --project simply-gitlab",
|
|
214
|
+
"env": {
|
|
215
|
+
"FORCE_COLOR": "2"
|
|
216
|
+
},
|
|
217
|
+
"dependencies": [
|
|
218
|
+
"../simply-gitlab-core:compile"
|
|
219
|
+
],
|
|
220
|
+
"files": [
|
|
221
|
+
"test/**/*.ts",
|
|
222
|
+
"src/**/*.ts",
|
|
223
|
+
"**/tsconfig.json",
|
|
224
|
+
"../../tsconfig.json",
|
|
225
|
+
"vitest.config.ts",
|
|
226
|
+
"!*.nut.ts"
|
|
227
|
+
],
|
|
228
|
+
"output": [
|
|
229
|
+
"coverage/**"
|
|
230
|
+
]
|
|
231
|
+
},
|
|
232
|
+
"test:watch": {
|
|
233
|
+
"command": "vitest watch --project simply-gitlab",
|
|
234
|
+
"env": {
|
|
235
|
+
"FORCE_COLOR": "2"
|
|
236
|
+
},
|
|
237
|
+
"dependencies": [
|
|
238
|
+
"../simply-gitlab-core:compile"
|
|
239
|
+
],
|
|
240
|
+
"service": true
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|