Skip to content

Commit 3741ca4

Browse files
sestinjclaude
andcommitted
feat: add --path flag to import from subdirectories
Allows importing checks/agents from a subdirectory within a repo, enabling a single repo to host multiple starter packs. Usage: npx create-software-factory --from owner/repo --path nextjs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3efc4b9 commit 3741ca4

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

src/commands/import.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,29 @@ export function importCommand(program) {
1111
.command('import')
1212
.description('Import .continue/checks and agents from a GitHub repo')
1313
.requiredOption('--from <repo>', 'GitHub repo (owner/repo)')
14+
.option('--path <path>', 'Subdirectory within the repo to import from')
1415
.option('--token <token>', 'GitHub token for private repos')
1516
.option('--branch <branch>', 'Branch to fetch from')
1617
.option('--dir <path>', 'Target directory', process.cwd())
1718
.action(async (opts) => {
18-
const { from: repo, token, branch, dir } = opts;
19+
const { from: repo, path: subPath, token, branch, dir } = opts;
1920
const fetchOpts = { token, branch };
2021

22+
const checksDir = subPath
23+
? `${subPath}/.continue/checks`
24+
: '.continue/checks';
25+
const agentsDir = subPath
26+
? `${subPath}/.continue/agents`
27+
: '.continue/agents';
28+
2129
console.log();
22-
const spinner = ora(`Fetching from ${repo}...`).start();
30+
const spinner = ora(`Fetching from ${repo}${subPath ? `/${subPath}` : ''}...`).start();
2331

2432
let checks, agents;
2533
try {
2634
[checks, agents] = await Promise.all([
27-
fetchDirectory(repo, '.continue/checks', fetchOpts),
28-
fetchDirectory(repo, '.continue/agents', fetchOpts),
35+
fetchDirectory(repo, checksDir, fetchOpts),
36+
fetchDirectory(repo, agentsDir, fetchOpts),
2937
]);
3038
} catch (err) {
3139
spinner.fail(err.message);

0 commit comments

Comments
 (0)