@dgxo/mashadevcli 1.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.
Files changed (140) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +393 -0
  3. package/bundle/builtin/skill-creator/SKILL.md +382 -0
  4. package/bundle/builtin/skill-creator/scripts/init_skill.cjs +239 -0
  5. package/bundle/builtin/skill-creator/scripts/package_skill.cjs +131 -0
  6. package/bundle/builtin/skill-creator/scripts/validate_skill.cjs +131 -0
  7. package/bundle/docs/CONTRIBUTING.md +1 -0
  8. package/bundle/docs/admin/enterprise-controls.md +115 -0
  9. package/bundle/docs/assets/connected_devtools.png +0 -0
  10. package/bundle/docs/assets/gemini-screenshot.png +0 -0
  11. package/bundle/docs/assets/monitoring-dashboard-logs.png +0 -0
  12. package/bundle/docs/assets/monitoring-dashboard-metrics.png +0 -0
  13. package/bundle/docs/assets/monitoring-dashboard-overview.png +0 -0
  14. package/bundle/docs/assets/release_patch.png +0 -0
  15. package/bundle/docs/assets/theme-ansi-light.png +0 -0
  16. package/bundle/docs/assets/theme-ansi.png +0 -0
  17. package/bundle/docs/assets/theme-atom-one.png +0 -0
  18. package/bundle/docs/assets/theme-ayu-light.png +0 -0
  19. package/bundle/docs/assets/theme-ayu.png +0 -0
  20. package/bundle/docs/assets/theme-custom.png +0 -0
  21. package/bundle/docs/assets/theme-default-light.png +0 -0
  22. package/bundle/docs/assets/theme-default.png +0 -0
  23. package/bundle/docs/assets/theme-dracula.png +0 -0
  24. package/bundle/docs/assets/theme-github-light.png +0 -0
  25. package/bundle/docs/assets/theme-github.png +0 -0
  26. package/bundle/docs/assets/theme-google-light.png +0 -0
  27. package/bundle/docs/assets/theme-xcode-light.png +0 -0
  28. package/bundle/docs/changelogs/index.md +867 -0
  29. package/bundle/docs/changelogs/latest.md +208 -0
  30. package/bundle/docs/changelogs/preview.md +187 -0
  31. package/bundle/docs/cli/checkpointing.md +93 -0
  32. package/bundle/docs/cli/cli-reference.md +115 -0
  33. package/bundle/docs/cli/creating-skills.md +80 -0
  34. package/bundle/docs/cli/custom-commands.md +327 -0
  35. package/bundle/docs/cli/enterprise.md +604 -0
  36. package/bundle/docs/cli/gemini-ignore.md +71 -0
  37. package/bundle/docs/cli/gemini-md.md +116 -0
  38. package/bundle/docs/cli/generation-settings.md +210 -0
  39. package/bundle/docs/cli/headless.md +50 -0
  40. package/bundle/docs/cli/model-routing.md +42 -0
  41. package/bundle/docs/cli/model.md +53 -0
  42. package/bundle/docs/cli/plan-mode.md +375 -0
  43. package/bundle/docs/cli/rewind.md +51 -0
  44. package/bundle/docs/cli/sandbox.md +257 -0
  45. package/bundle/docs/cli/session-management.md +184 -0
  46. package/bundle/docs/cli/settings.md +165 -0
  47. package/bundle/docs/cli/skills.md +134 -0
  48. package/bundle/docs/cli/system-prompt.md +125 -0
  49. package/bundle/docs/cli/telemetry.md +922 -0
  50. package/bundle/docs/cli/themes.md +269 -0
  51. package/bundle/docs/cli/token-caching.md +20 -0
  52. package/bundle/docs/cli/trusted-folders.md +126 -0
  53. package/bundle/docs/cli/tutorials/automation.md +283 -0
  54. package/bundle/docs/cli/tutorials/file-management.md +142 -0
  55. package/bundle/docs/cli/tutorials/mcp-setup.md +113 -0
  56. package/bundle/docs/cli/tutorials/memory-management.md +126 -0
  57. package/bundle/docs/cli/tutorials/session-management.md +105 -0
  58. package/bundle/docs/cli/tutorials/shell-commands.md +107 -0
  59. package/bundle/docs/cli/tutorials/skills-getting-started.md +110 -0
  60. package/bundle/docs/cli/tutorials/task-planning.md +93 -0
  61. package/bundle/docs/cli/tutorials/web-tools.md +78 -0
  62. package/bundle/docs/core/index.md +107 -0
  63. package/bundle/docs/core/remote-agents.md +84 -0
  64. package/bundle/docs/core/subagents.md +307 -0
  65. package/bundle/docs/examples/proxy-script.md +83 -0
  66. package/bundle/docs/extensions/best-practices.md +188 -0
  67. package/bundle/docs/extensions/index.md +61 -0
  68. package/bundle/docs/extensions/reference.md +333 -0
  69. package/bundle/docs/extensions/releasing.md +154 -0
  70. package/bundle/docs/extensions/writing-extensions.md +308 -0
  71. package/bundle/docs/get-started/authentication.md +402 -0
  72. package/bundle/docs/get-started/examples.md +139 -0
  73. package/bundle/docs/get-started/gemini-3.md +115 -0
  74. package/bundle/docs/get-started/index.md +82 -0
  75. package/bundle/docs/get-started/installation.md +174 -0
  76. package/bundle/docs/hooks/best-practices.md +709 -0
  77. package/bundle/docs/hooks/index.md +164 -0
  78. package/bundle/docs/hooks/reference.md +330 -0
  79. package/bundle/docs/hooks/writing-hooks.md +474 -0
  80. package/bundle/docs/ide-integration/ide-companion-spec.md +267 -0
  81. package/bundle/docs/ide-integration/index.md +224 -0
  82. package/bundle/docs/index.md +141 -0
  83. package/bundle/docs/integration-tests.md +211 -0
  84. package/bundle/docs/issue-and-pr-automation.md +172 -0
  85. package/bundle/docs/local-development.md +134 -0
  86. package/bundle/docs/mermaid/context.mmd +103 -0
  87. package/bundle/docs/mermaid/render-path.mmd +64 -0
  88. package/bundle/docs/npm.md +62 -0
  89. package/bundle/docs/redirects.json +20 -0
  90. package/bundle/docs/reference/commands.md +526 -0
  91. package/bundle/docs/reference/configuration.md +1786 -0
  92. package/bundle/docs/reference/keyboard-shortcuts.md +164 -0
  93. package/bundle/docs/reference/memport.md +246 -0
  94. package/bundle/docs/reference/policy-engine.md +364 -0
  95. package/bundle/docs/reference/tools.md +106 -0
  96. package/bundle/docs/release-confidence.md +164 -0
  97. package/bundle/docs/releases.md +540 -0
  98. package/bundle/docs/resources/faq.md +175 -0
  99. package/bundle/docs/resources/quota-and-pricing.md +165 -0
  100. package/bundle/docs/resources/tos-privacy.md +102 -0
  101. package/bundle/docs/resources/troubleshooting.md +176 -0
  102. package/bundle/docs/resources/uninstall.md +56 -0
  103. package/bundle/docs/sidebar.json +233 -0
  104. package/bundle/docs/tools/activate-skill.md +43 -0
  105. package/bundle/docs/tools/ask-user.md +95 -0
  106. package/bundle/docs/tools/file-system.md +129 -0
  107. package/bundle/docs/tools/internal-docs.md +46 -0
  108. package/bundle/docs/tools/mcp-server.md +1150 -0
  109. package/bundle/docs/tools/memory.md +35 -0
  110. package/bundle/docs/tools/planning.md +58 -0
  111. package/bundle/docs/tools/shell.md +216 -0
  112. package/bundle/docs/tools/todos.md +35 -0
  113. package/bundle/docs/tools/web-fetch.md +35 -0
  114. package/bundle/docs/tools/web-search.md +32 -0
  115. package/bundle/docs/update/update-guide.md +111 -0
  116. package/bundle/masha.js +563471 -0
  117. package/bundle/node_modules/@dgxo/mashadevcli-devtools/dist/client/main.js +89 -0
  118. package/bundle/node_modules/@dgxo/mashadevcli-devtools/dist/src/_client-assets.d.ts +7 -0
  119. package/bundle/node_modules/@dgxo/mashadevcli-devtools/dist/src/_client-assets.js +9 -0
  120. package/bundle/node_modules/@dgxo/mashadevcli-devtools/dist/src/_client-assets.js.map +1 -0
  121. package/bundle/node_modules/@dgxo/mashadevcli-devtools/dist/src/index.d.ts +48 -0
  122. package/bundle/node_modules/@dgxo/mashadevcli-devtools/dist/src/index.js +299 -0
  123. package/bundle/node_modules/@dgxo/mashadevcli-devtools/dist/src/index.js.map +1 -0
  124. package/bundle/node_modules/@dgxo/mashadevcli-devtools/dist/src/types.d.ts +36 -0
  125. package/bundle/node_modules/@dgxo/mashadevcli-devtools/dist/src/types.js +7 -0
  126. package/bundle/node_modules/@dgxo/mashadevcli-devtools/dist/src/types.js.map +1 -0
  127. package/bundle/node_modules/@dgxo/mashadevcli-devtools/package.json +32 -0
  128. package/bundle/policies/conseca.toml +6 -0
  129. package/bundle/policies/discovered.toml +8 -0
  130. package/bundle/policies/plan.toml +109 -0
  131. package/bundle/policies/read-only.toml +53 -0
  132. package/bundle/policies/write.toml +80 -0
  133. package/bundle/policies/yolo.toml +54 -0
  134. package/bundle/sandbox-macos-permissive-open.sb +27 -0
  135. package/bundle/sandbox-macos-permissive-proxied.sb +37 -0
  136. package/bundle/sandbox-macos-restrictive-open.sb +96 -0
  137. package/bundle/sandbox-macos-restrictive-proxied.sb +98 -0
  138. package/bundle/sandbox-macos-strict-open.sb +131 -0
  139. package/bundle/sandbox-macos-strict-proxied.sb +133 -0
  140. package/package.json +169 -0
@@ -0,0 +1,131 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * @license
5
+ * Copyright 2026 Google LLC
6
+ * SPDX-License-Identifier: Apache-2.0
7
+ */
8
+
9
+ /**
10
+ * Skill Packager - Creates a distributable .skill file of a skill folder
11
+ *
12
+ * Usage:
13
+ * node package_skill.js <path/to/skill-folder> [output-directory]
14
+ */
15
+
16
+ const path = require('node:path');
17
+ const { spawnSync } = require('node:child_process');
18
+ const { validateSkill } = require('./validate_skill.cjs');
19
+
20
+ async function main() {
21
+ const args = process.argv.slice(2);
22
+ if (args.length < 1) {
23
+ console.log(
24
+ 'Usage: node package_skill.js <path/to/skill-folder> [output-directory]',
25
+ );
26
+ process.exit(1);
27
+ }
28
+
29
+ const skillPathArg = args[0];
30
+ const outputDirArg = args[1];
31
+
32
+ if (
33
+ skillPathArg.includes('..') ||
34
+ (outputDirArg && outputDirArg.includes('..'))
35
+ ) {
36
+ console.error('❌ Error: Path traversal detected in arguments.');
37
+ process.exit(1);
38
+ }
39
+
40
+ const skillPath = path.resolve(skillPathArg);
41
+ const outputDir = outputDirArg ? path.resolve(outputDirArg) : process.cwd();
42
+ const skillName = path.basename(skillPath);
43
+
44
+ // 1. Validate first
45
+ console.log('🔍 Validating skill...');
46
+ const result = validateSkill(skillPath);
47
+ if (!result.valid) {
48
+ console.error(`❌ Validation failed: ${result.message}`);
49
+ process.exit(1);
50
+ }
51
+
52
+ if (result.warning) {
53
+ console.warn(`⚠️ ${result.warning}`);
54
+ console.log('Please resolve all TODOs before packaging.');
55
+ process.exit(1);
56
+ }
57
+ console.log('✅ Skill is valid!');
58
+
59
+ // 2. Package
60
+ const outputFilename = path.join(outputDir, `${skillName}.skill`);
61
+
62
+ try {
63
+ // Zip everything except junk, keeping the folder structure
64
+ // We'll use the native 'zip' command for simplicity in a CLI environment
65
+ // or we could use a JS library, but zip is ubiquitous on darwin/linux.
66
+
67
+ // Command to zip:
68
+ // -r: recursive
69
+ // -x: exclude patterns
70
+ // Run the zip command from within the directory to avoid parent folder nesting
71
+ let zipProcess = spawnSync('zip', ['-r', outputFilename, '.'], {
72
+ cwd: skillPath,
73
+ stdio: 'inherit',
74
+ });
75
+
76
+ if (zipProcess.error || zipProcess.status !== 0) {
77
+ if (process.platform === 'win32') {
78
+ // Fallback to PowerShell Compress-Archive on Windows
79
+ // Note: Compress-Archive only supports .zip extension, so we zip to .zip and rename
80
+ console.log('zip command not found, falling back to PowerShell...');
81
+ const tempZip = outputFilename + '.zip';
82
+ // Escape single quotes for PowerShell (replace ' with '') and use single quotes for the path
83
+ const safeTempZip = tempZip.replace(/'/g, "''");
84
+ zipProcess = spawnSync(
85
+ 'powershell.exe',
86
+ [
87
+ '-NoProfile',
88
+ '-Command',
89
+ `Compress-Archive -Path .\\* -DestinationPath '${safeTempZip}' -Force`,
90
+ ],
91
+ {
92
+ cwd: skillPath,
93
+ stdio: 'inherit',
94
+ },
95
+ );
96
+
97
+ if (zipProcess.status === 0 && require('node:fs').existsSync(tempZip)) {
98
+ require('node:fs').renameSync(tempZip, outputFilename);
99
+ }
100
+ } else {
101
+ // Fallback to tar on Unix-like systems
102
+ console.log('zip command not found, falling back to tar...');
103
+ zipProcess = spawnSync(
104
+ 'tar',
105
+ ['-a', '-c', '--format=zip', '-f', outputFilename, '.'],
106
+ {
107
+ cwd: skillPath,
108
+ stdio: 'inherit',
109
+ },
110
+ );
111
+ }
112
+ }
113
+
114
+ if (zipProcess.error) {
115
+ throw zipProcess.error;
116
+ }
117
+
118
+ if (zipProcess.status !== 0) {
119
+ throw new Error(
120
+ `Packaging command failed with exit code ${zipProcess.status}`,
121
+ );
122
+ }
123
+
124
+ console.log(`✅ Successfully packaged skill to: ${outputFilename}`);
125
+ } catch (err) {
126
+ console.error(`❌ Error packaging: ${err.message}`);
127
+ process.exit(1);
128
+ }
129
+ }
130
+
131
+ main();
@@ -0,0 +1,131 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ /**
8
+ * Quick validation logic for skills.
9
+ * Leveraging existing dependencies when possible or providing a zero-dep fallback.
10
+ */
11
+
12
+ const fs = require('node:fs');
13
+ const path = require('node:path');
14
+
15
+ function validateSkill(skillPath) {
16
+ if (!fs.existsSync(skillPath) || !fs.statSync(skillPath).isDirectory()) {
17
+ return { valid: false, message: `Path is not a directory: ${skillPath}` };
18
+ }
19
+
20
+ const skillMdPath = path.join(skillPath, 'SKILL.md');
21
+ if (!fs.existsSync(skillMdPath)) {
22
+ return { valid: false, message: 'SKILL.md not found' };
23
+ }
24
+
25
+ const content = fs.readFileSync(skillMdPath, 'utf8');
26
+ if (!content.startsWith('---')) {
27
+ return { valid: false, message: 'No YAML frontmatter found' };
28
+ }
29
+
30
+ const parts = content.split('---');
31
+ if (parts.length < 3) {
32
+ return { valid: false, message: 'Invalid frontmatter format' };
33
+ }
34
+
35
+ const frontmatterText = parts[1];
36
+
37
+ const nameMatch = frontmatterText.match(/^name:\s*(.+)$/m);
38
+ // Match description: "text" or description: 'text' or description: text
39
+ const descMatch = frontmatterText.match(
40
+ /^description:\s*(?:'([^']*)'|"([^"]*)"|(.+))$/m,
41
+ );
42
+
43
+ if (!nameMatch)
44
+ return { valid: false, message: 'Missing "name" in frontmatter' };
45
+ if (!descMatch)
46
+ return {
47
+ valid: false,
48
+ message: 'Description must be a single-line string: description: ...',
49
+ };
50
+
51
+ const name = nameMatch[1].trim();
52
+ const description = (
53
+ descMatch[1] !== undefined
54
+ ? descMatch[1]
55
+ : descMatch[2] !== undefined
56
+ ? descMatch[2]
57
+ : descMatch[3] || ''
58
+ ).trim();
59
+
60
+ if (description.includes('\n')) {
61
+ return {
62
+ valid: false,
63
+ message: 'Description must be a single line (no newlines)',
64
+ };
65
+ }
66
+
67
+ if (!/^[a-z0-9-]+$/.test(name)) {
68
+ return { valid: false, message: `Name "${name}" should be hyphen-case` };
69
+ }
70
+
71
+ if (description.length > 1024) {
72
+ return { valid: false, message: 'Description is too long (max 1024)' };
73
+ }
74
+
75
+ // Check for TODOs
76
+ const files = getAllFiles(skillPath);
77
+ for (const file of files) {
78
+ const fileContent = fs.readFileSync(file, 'utf8');
79
+ if (fileContent.includes('TODO:')) {
80
+ return {
81
+ valid: true,
82
+ message: 'Skill has unresolved TODOs',
83
+ warning: `Found unresolved TODO in ${path.relative(skillPath, file)}`,
84
+ };
85
+ }
86
+ }
87
+
88
+ return { valid: true, message: 'Skill is valid!' };
89
+ }
90
+
91
+ function getAllFiles(dir, fileList = []) {
92
+ const files = fs.readdirSync(dir);
93
+ files.forEach((file) => {
94
+ const name = path.join(dir, file);
95
+ if (fs.statSync(name).isDirectory()) {
96
+ if (!['node_modules', '.git', '__pycache__'].includes(file)) {
97
+ getAllFiles(name, fileList);
98
+ }
99
+ } else {
100
+ fileList.push(name);
101
+ }
102
+ });
103
+ return fileList;
104
+ }
105
+
106
+ if (require.main === module) {
107
+ const args = process.argv.slice(2);
108
+ if (args.length !== 1) {
109
+ console.log('Usage: node validate_skill.js <skill_directory>');
110
+ process.exit(1);
111
+ }
112
+
113
+ const skillDirArg = args[0];
114
+ if (skillDirArg.includes('..')) {
115
+ console.error('❌ Error: Path traversal detected in skill directory path.');
116
+ process.exit(1);
117
+ }
118
+
119
+ const result = validateSkill(path.resolve(skillDirArg));
120
+ if (result.warning) {
121
+ console.warn(`⚠️ ${result.warning}`);
122
+ }
123
+ if (result.valid) {
124
+ console.log(`✅ ${result.message}`);
125
+ } else {
126
+ console.error(`❌ ${result.message}`);
127
+ process.exit(1);
128
+ }
129
+ }
130
+
131
+ module.exports = { validateSkill };
@@ -0,0 +1 @@
1
+ ../CONTRIBUTING.md
@@ -0,0 +1,115 @@
1
+ # Enterprise Admin Controls
2
+
3
+ Gemini CLI empowers enterprise administrators to manage and enforce security
4
+ policies and configuration settings across their entire organization. Secure
5
+ defaults are enabled automatically for all enterprise users, but can be
6
+ customized via the [Management Console](https://goo.gle/manage-gemini-cli).
7
+
8
+ **Enterprise Admin Controls are enforced globally and cannot be overridden by
9
+ users locally**, ensuring a consistent security posture.
10
+
11
+ ## Admin Controls vs. System Settings
12
+
13
+ While [System-wide settings](../cli/settings.md) act as convenient configuration
14
+ overrides, they can still be modified by users with sufficient privileges. In
15
+ contrast, admin controls are immutable at the local level, making them the
16
+ preferred method for enforcing policy.
17
+
18
+ ## Available Controls
19
+
20
+ ### Strict Mode
21
+
22
+ **Enabled/Disabled** | Default: enabled
23
+
24
+ If enabled, users will not be able to enter yolo mode.
25
+
26
+ ### Extensions
27
+
28
+ **Enabled/Disabled** | Default: disabled
29
+
30
+ If disabled, users will not be able to use or install extensions. See
31
+ [Extensions](../extensions/index.md) for more details.
32
+
33
+ ### MCP
34
+
35
+ #### Enabled/Disabled
36
+
37
+ **Enabled/Disabled** | Default: disabled
38
+
39
+ If disabled, users will not be able to use MCP servers. See
40
+ [MCP Server Integration](../tools/mcp-server.md) for more details.
41
+
42
+ #### MCP Servers (preview)
43
+
44
+ **Default**: empty
45
+
46
+ Allows administrators to define an explicit allowlist of MCP servers. This
47
+ guarantees that users can only connect to trusted MCP servers defined by the
48
+ organization.
49
+
50
+ **Allowlist Format:**
51
+
52
+ ```json
53
+ {
54
+ "mcpServers": {
55
+ "external-provider": {
56
+ "url": "https://api.mcp-provider.com",
57
+ "type": "sse",
58
+ "trust": true,
59
+ "includeTools": ["toolA", "toolB"],
60
+ "excludeTools": []
61
+ },
62
+ "internal-corp-tool": {
63
+ "url": "https://mcp.internal-tool.corp",
64
+ "type": "http",
65
+ "includeTools": [],
66
+ "excludeTools": ["adminTool"]
67
+ }
68
+ }
69
+ }
70
+ ```
71
+
72
+ **Supported Fields:**
73
+
74
+ - `url`: (Required) The full URL of the MCP server endpoint.
75
+ - `type`: (Required) The connection type (e.g., `sse` or `http`).
76
+ - `trust`: (Optional) If set to `true`, the server is trusted and tool execution
77
+ will not require user approval.
78
+ - `includeTools`: (Optional) An explicit list of tool names to allow. If
79
+ specified, only these tools will be available.
80
+ - `excludeTools`: (Optional) A list of tool names to hide. These tools will be
81
+ blocked.
82
+
83
+ **Client Enforcement Logic:**
84
+
85
+ - **Empty Allowlist**: If the admin allowlist is empty, the client uses the
86
+ user’s local configuration as is (unless the MCP toggle above is disabled).
87
+ - **Active Allowlist**: If the allowlist contains one or more servers, **all
88
+ locally configured servers not present in the allowlist are ignored**.
89
+ - **Configuration Merging**: For a server to be active, it must exist in
90
+ **both** the admin allowlist and the user’s local configuration (matched by
91
+ name). The client merges these definitions as follows:
92
+ - **Override Fields**: The `url`, `type`, & `trust` are always taken from the
93
+ admin allowlist, overriding any local values.
94
+ - **Tools Filtering**: If `includeTools` or `excludeTools` are defined in the
95
+ allowlist, the admin’s rules are used exclusively. If both are undefined in
96
+ the admin allowlist, the client falls back to the user’s local tool
97
+ settings.
98
+ - **Cleared Fields**: To ensure security and consistency, the client
99
+ automatically clears local execution fields (`command`, `args`, `env`,
100
+ `cwd`, `httpUrl`, `tcp`). This prevents users from overriding the connection
101
+ method.
102
+ - **Other Fields**: All other MCP fields are pulled from the user’s local
103
+ configuration.
104
+ - **Missing Allowlisted Servers**: If a server appears in the admin allowlist
105
+ but is missing from the local configuration, it will not be initialized. This
106
+ ensures users maintain final control over which permitted servers are actually
107
+ active in their environment.
108
+
109
+ ### Unmanaged Capabilities
110
+
111
+ **Enabled/Disabled** | Default: disabled
112
+
113
+ If disabled, users will not be able to use certain features. Currently, this
114
+ control disables Agent Skills. See [Agent Skills](../cli/skills.md) for more
115
+ details.
Binary file