Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,28 @@ npm install
npm link
```

### Claude Code Skill

Install the packaged Jira skill into the current project:

```bash
jira install-skill
```

This copies the skill to `./.claude/skills/jira/SKILL.md`.

If the file already exists, the command errors by default. Use `--force` to overwrite:

```bash
jira install-skill --force
```

Use a custom destination directory if needed:

```bash
jira install-skill --dest ./custom/skills/jira
```

### Setup

1. **Configure using CLI options (Bearer auth - recommended):**
Expand Down
41 changes: 41 additions & 0 deletions bin/commands/install-skill.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
const { Command } = require('commander');
const fs = require('fs');
const path = require('path');
const { expandHomePath } = require('../../lib/utils');

function createInstallSkillCommand(factory) {
return new Command('install-skill')
.description('install the packaged Jira skill into the current project')
.option('--dest <directory>', 'target directory', './.claude/skills/jira')
.option('-f, --force', 'overwrite existing skill file without prompting')
.action((options) => {
const io = factory.getIOStreams();
const analytics = factory.getAnalytics();
const sourceFile = path.join(__dirname, '..', '..', 'skills', 'jira', 'SKILL.md');
const destinationDir = path.resolve(expandHomePath(options.dest));
const destinationFile = path.join(destinationDir, 'SKILL.md');

try {
if (!fs.existsSync(sourceFile)) {
throw new Error('packaged skill file not found in this installation');
}

if (fs.existsSync(destinationFile) && !options.force) {
throw new Error(`skill file already exists at ${destinationFile}. Re-run with --force to overwrite.`);
}

fs.mkdirSync(destinationDir, { recursive: true });
fs.copyFileSync(sourceFile, destinationFile);

io.success('Skill installed successfully');
io.info(`Location: ${destinationFile}`);
analytics.track('install-skill', { overwritten: Boolean(options.force) });
} catch (err) {
analytics.track('install-skill', { overwritten: Boolean(options.force), success: false });
io.error(`Failed to install skill: ${err.message}`);
process.exit(1);
}
});
}

module.exports = createInstallSkillCommand;
2 changes: 2 additions & 0 deletions bin/root.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const { Command } = require('commander');

// Import command modules
const createConfigCommand = require('./commands/config');
const createInstallSkillCommand = require('./commands/install-skill');
const createIssueCommand = require('./commands/issue');
const createProjectCommand = require('./commands/project');
const createSprintCommand = require('./commands/sprint');
Expand Down Expand Up @@ -49,6 +50,7 @@ async function createRootCommand(factory, version) {
// Core commands group (alphabetically ordered for better UX)
const coreCommands = [
createConfigCommand(factory),
createInstallSkillCommand(factory),
createIssueCommand(factory),
createProjectCommand(factory),
createSprintCommand(factory)
Expand Down
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@
"url": "https://github.com/pchuri/jira-cli/issues"
},
"homepage": "https://github.com/pchuri/jira-cli#readme",
"files": [
Comment thread
rajbdilip marked this conversation as resolved.
"bin/",
"lib/",
"skills/",
"README.md",
"LICENSE",
"SECURITY.md"
],
"publishConfig": {
"access": "public"
},
Expand Down
Loading
Loading