Skip to content

add extra CLI commands to syskit - #566

Open
Rezenders wants to merge 3 commits into
rock-core:transition-to-runkitfrom
tidewise:bundle-dir
Open

add extra CLI commands to syskit#566
Rezenders wants to merge 3 commits into
rock-core:transition-to-runkitfrom
tidewise:bundle-dir

Conversation

@Rezenders

@Rezenders Rezenders commented Jul 23, 2026

Copy link
Copy Markdown

add bundle-dir command to syskit. This command returns the absolute path of a bundle.
Usage example: syskit bundle-dir my_bundle

add syskit config to export a robot's configuration file.
Usage example: syskit config my_robot --from-bundle my_bundle --key parent_key.child_key

Related to: rock-gazebo/simulation-rock_gazebo#70

@Rezenders Rezenders changed the title add bundle-dir command add extra CLI commands to syskit Jul 27, 2026
@Rezenders

Copy link
Copy Markdown
Author

@jhonasiv @wvmcastro

Comment thread lib/syskit/cli/main.rb
Comment on lines 43 to +56

desc "bundle_dir NAME", "print the directory of a bundle"
def bundle_dir(name)
require "rock/bundle" unless defined?(Rock::Bundles)

bundle = Rock::Bundles.each_bundle.find { |b| b.name == name }
if bundle
puts bundle.path
else
$stderr.puts "No bundle named '#{name}' found."
$stderr.puts "Available bundles are: #{Rock::Bundles.each_bundle.map(&:name).sort.join(', ')}"
exit 1
end
end

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This possibly exists in autoproj, or at least it is possible to get this information from an autoproj command (ie autoproj show bundles/bla)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you can find packages with autoproj locate PACKAGE_NAME or with autoproj show PACKAGE_NAME as you said. But IMO it can be helpful to have this extra command, it is simple, easy to remember, and doesn't require autoproj. On the other hand, it doesn't bring any disadvantages

Comment thread lib/syskit/cli/main.rb
Comment on lines +58 to +61
desc "config ROBOT", "print the configuration of a given robot"
option :key, type: :string, repeatable: true, default: []
option :from_bundle, type: :string, default: nil
def config(robot_name)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typically, syskit is ran from the bundle itself. Besides that, I think a more useful command would to extract the variables inside the Conf variable from a syskit run, but that is way more complex (and might encounter friction if Conf is used as something dynamic).

I dont think that what you aimed for here should be packed with syskit, it can mostly be resolved by using a sequence of bash commands, and it is outside of syskit's scope

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a more useful command would to extract the variables inside the Conf variable from a syskit run, but that is way more complex (and might encounter friction if Conf is used as something dynamic).

I could also that, but I believe it should be a distinct command from this one. The current proposed syskit config command is designed to work without requiring the system to be running, which is nice to have. Otherwise, one would need to start the system to inspect the config files.
A part from the templated sdf generation use case we have in mind, this command could be useful for a quick inspection on the configuration of the system without needing to open all the files manually and read them, which is convenient.
Again, it doesn't bring any disadvantages adding support for this command.

syskit is ran from the bundle itself.

Yes, but for the templated SDF generation use case we dont run rock-gazebo necessarily from the robot bundle dir, we could run it from an arbitrary directory.

@jhonasiv
jhonasiv requested a review from doudou July 31, 2026 14:06
@Rezenders

Copy link
Copy Markdown
Author

@doudou

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants