From 37cc6477fa2cce2362ec4d81fb1278b019999149 Mon Sep 17 00:00:00 2001 From: Robert Fudge Date: Fri, 10 Apr 2026 08:22:12 -0230 Subject: [PATCH] (wip) document asynchronous changes to snapctl --- docs/how-to-guides/snap-development/use-snapctl.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/docs/how-to-guides/snap-development/use-snapctl.md b/docs/how-to-guides/snap-development/use-snapctl.md index 3de28cd..01f5255 100644 --- a/docs/how-to-guides/snap-development/use-snapctl.md +++ b/docs/how-to-guides/snap-development/use-snapctl.md @@ -102,15 +102,11 @@ snapctl remove + If these commands are run from a {ref}`hook `, the components will be installed/removed after the hook itself has run if it ended successfully. -## snapctl commands - -From within a snap, the [snapctl](https://snapcraft.io/docs/using-snapctl) command can be used to install and remove components from an application, including snap hooks and component hooks. The commands for this are: - -$ snapctl install + - -$ snapctl remove + - -If these commands are run from a hook, the components will be installed/removed after the hook itself has run if it ended successfully. +### Asynchronous Operation +These commands are run synchronously by default, however, if snapctl supports the _async_ feature, then the `--no-wait` flag can be used to +immediately return a change ID, which can then be polled with snapctl is-ready . To view all change-ids associated with a snapctl +context, the command `snapctl tasks` may be used. Optionally, the `--json` flag may be passed to return the data as JSON rather than a tabular +representation. ## Health state