MCPcopy Create free account
hub / github.com/deepnote/deepnote / generateFishCompletion

Function generateFishCompletion

packages/cli/src/completions.ts:493–613  ·  view source on GitHub ↗
(commands: string[])

Source from the content-addressed store, hash-verified

491}
492
493function generateFishCompletion(commands: string[]): string {
494 const blockTypes = FILTERABLE_BLOCK_TYPES.join(' ')
495
496 // Build the command completions
497 const commandCompletions = commands
498 .map(cmd => `complete -c deepnote -n __fish_use_subcommand -a ${cmd} -d '${fishCommandDescriptions[cmd] ?? cmd}'`)
499 .concat("complete -c deepnote -n __fish_use_subcommand -a help -d 'Display help for command'")
500 .join('\n')
501
502 // Build the help subcommand completions
503 const helpCommands = commands.join(' ')
504
505 return `# Fish completion for deepnote CLI
506# Save to ~/.config/fish/completions/deepnote.fish
507
508# Disable file completions by default
509complete -c deepnote -f
510
511# Global options
512complete -c deepnote -l help -s h -d 'Display help information'
513complete -c deepnote -l version -s v -d 'Display the CLI version'
514complete -c deepnote -l no-color -d 'Disable colored output'
515complete -c deepnote -l debug -d 'Show debug information'
516complete -c deepnote -l quiet -s q -d 'Suppress non-essential output'
517
518# Commands
519${commandCompletions}
520
521# inspect subcommand
522complete -c deepnote -n '__fish_seen_subcommand_from inspect' -s o -l output -d 'Output format' -xa 'json toon llm'
523complete -c deepnote -n '__fish_seen_subcommand_from inspect' -F -a '*.deepnote'
524
525# cat subcommand
526complete -c deepnote -n '__fish_seen_subcommand_from cat' -s o -l output -d 'Output format' -xa 'json llm'
527complete -c deepnote -n '__fish_seen_subcommand_from cat' -l notebook -d 'Show only blocks from specified notebook'
528complete -c deepnote -n '__fish_seen_subcommand_from cat' -l type -d 'Filter blocks by type' -xa '${blockTypes}'
529complete -c deepnote -n '__fish_seen_subcommand_from cat' -l tree -d 'Show structure only without block content'
530complete -c deepnote -n '__fish_seen_subcommand_from cat' -F -a '*.deepnote'
531
532# run subcommand
533complete -c deepnote -n '__fish_seen_subcommand_from run' -l python -d 'Path to Python interpreter'
534complete -c deepnote -n '__fish_seen_subcommand_from run' -l cwd -d 'Working directory for execution'
535complete -c deepnote -n '__fish_seen_subcommand_from run' -l notebook -d 'Run only the specified notebook'
536complete -c deepnote -n '__fish_seen_subcommand_from run' -l block -d 'Run only the specified block'
537complete -c deepnote -n '__fish_seen_subcommand_from run' -s i -l input -d 'Set input variable value (can be repeated)'
538complete -c deepnote -n '__fish_seen_subcommand_from run' -l list-inputs -d 'List all input variables without running'
539complete -c deepnote -n '__fish_seen_subcommand_from run' -s o -l output -d 'Output format' -xa 'json toon llm'
540complete -c deepnote -n '__fish_seen_subcommand_from run' -l dry-run -d 'Show what would be executed without running'
541complete -c deepnote -n '__fish_seen_subcommand_from run' -l top -d 'Display resource usage during execution'
542complete -c deepnote -n '__fish_seen_subcommand_from run' -l profile -d 'Show per-block timing and memory usage'
543complete -c deepnote -n '__fish_seen_subcommand_from run' -l open -d 'Open the project in Deepnote Cloud after successful execution'
544complete -c deepnote -n '__fish_seen_subcommand_from run' -F -a '*.deepnote' -a '*.ipynb' -a '*.qmd' -a '*.py'
545
546# open subcommand
547complete -c deepnote -n '__fish_seen_subcommand_from open' -l domain -d 'Deepnote domain'
548complete -c deepnote -n '__fish_seen_subcommand_from open' -s o -l output -d 'Output format' -xa 'json llm'
549complete -c deepnote -n '__fish_seen_subcommand_from open' -F -a '*.deepnote'
550

Callers 1

generateCompletionScriptFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected