@@ -28,7 +28,7 @@ var createCmd = &cobra.Command{
2828}
2929
3030func init () {
31- createCmd .Flags ().BoolVar (& pullFlag , "pull" , false , "Force re-pull image even if found locally" )
31+ createCmd .Flags ().BoolVar (& pullFlag , "pull" , false , "Force re-pull image from registry ( even if already present locally) " )
3232 createCmd .Flags ().StringVar (& fromSnapshotFlag , "from-snapshot" , "" , "Create instance from a saved snapshot" )
3333}
3434
@@ -48,21 +48,21 @@ func runCreate(cmd *cobra.Command, args []string) error {
4848 return err
4949 }
5050
51- // Check image exists
51+ // Check image exists; auto-pull if missing, force-pull if --pull flag set.
5252 exists , err := container .ImageExists (cli , cfg .ImageRef ())
5353 if err != nil {
5454 return err
5555 }
56- if ! exists {
57- if pullFlag {
56+ if ! exists || pullFlag {
57+ if ! exists {
5858 fmt .Printf ("Image %s not found locally, pulling from registry...\n " , cfg .ImageRef ())
59- if pullErr := container .PullImage (cli , cfg .Image .Name , cfg .Image .Tag , os .Stdout ); pullErr != nil {
60- return fmt .Errorf ("pull failed: %v\n Run 'clawfleet build' to build it manually" , pullErr )
61- }
62- fmt .Println ("Image pulled successfully." )
6359 } else {
64- return fmt .Errorf ("Image %s not found. Run 'clawfleet build' or build via Dashboard.\n Use --pull to pull from the registry instead." , cfg .ImageRef ())
60+ fmt .Printf ("Pulling latest %s from registry...\n " , cfg .ImageRef ())
61+ }
62+ if pullErr := container .PullImage (cli , cfg .Image .Name , cfg .Image .Tag , os .Stdout ); pullErr != nil {
63+ return fmt .Errorf ("pull failed: %v\n Run 'clawfleet build' to build it manually" , pullErr )
6564 }
65+ fmt .Println ("Image pulled successfully." )
6666 }
6767
6868 // Ensure network
0 commit comments