@@ -179,7 +179,7 @@ export const kvNamespaceDeleteCommand = createCommand({
179179 printResourceLocation ( "remote" ) ;
180180 let id ;
181181 try {
182- id = getKVNamespaceId ( args , config ) ;
182+ id = await getKVNamespaceId ( args , config , false ) ;
183183 } catch ( e ) {
184184 throw new CommandLineArgsError (
185185 "Not able to delete namespace.\n" + ( ( e as Error ) . message ?? e )
@@ -374,7 +374,7 @@ export const kvKeyPutCommand = createCommand({
374374 async handler ( { key, ttl, expiration, metadata, ...args } ) {
375375 const localMode = isLocal ( args ) ;
376376 const config = readConfig ( args ) ;
377- const namespaceId = getKVNamespaceId ( args , config ) ;
377+ const namespaceId = await getKVNamespaceId ( args , config , localMode ) ;
378378 // One of `args.path` and `args.value` must be defined
379379 const value = args . path
380380 ? readFileSyncToBuffer ( args . path )
@@ -486,7 +486,7 @@ export const kvKeyListCommand = createCommand({
486486 const localMode = isLocal ( args ) ;
487487 // TODO: support for limit+cursor (pagination)
488488 const config = readConfig ( args ) ;
489- const namespaceId = getKVNamespaceId ( args , config ) ;
489+ const namespaceId = await getKVNamespaceId ( args , config , localMode ) ;
490490
491491 let result : NamespaceKeyInfo [ ] ;
492492 let metricEvent : EventNames ;
@@ -577,7 +577,7 @@ export const kvKeyGetCommand = createCommand({
577577 async handler ( { key, ...args } ) {
578578 const localMode = isLocal ( args ) ;
579579 const config = readConfig ( args ) ;
580- const namespaceId = getKVNamespaceId ( args , config ) ;
580+ const namespaceId = await getKVNamespaceId ( args , config , localMode ) ;
581581
582582 let bufferKVValue ;
583583 let metricEvent : EventNames ;
@@ -669,7 +669,7 @@ export const kvKeyDeleteCommand = createCommand({
669669 async handler ( { key, ...args } ) {
670670 const localMode = isLocal ( args ) ;
671671 const config = readConfig ( args ) ;
672- const namespaceId = getKVNamespaceId ( args , config ) ;
672+ const namespaceId = await getKVNamespaceId ( args , config , localMode ) ;
673673
674674 logger . log ( `Deleting the key "${ key } " on namespace ${ namespaceId } .` ) ;
675675
@@ -744,7 +744,7 @@ export const kvBulkGetCommand = createCommand({
744744 async handler ( { filename, ...args } ) {
745745 const localMode = isLocal ( args ) ;
746746 const config = readConfig ( args ) ;
747- const namespaceId = getKVNamespaceId ( args , config ) ;
747+ const namespaceId = await getKVNamespaceId ( args , config , localMode ) ;
748748
749749 const content = parseJSON ( readFileSync ( filename ) , filename ) as (
750750 | string
@@ -886,7 +886,7 @@ export const kvBulkPutCommand = createCommand({
886886 // but we'll do that in the future if needed.
887887
888888 const config = readConfig ( args ) ;
889- const namespaceId = getKVNamespaceId ( args , config ) ;
889+ const namespaceId = await getKVNamespaceId ( args , config , localMode ) ;
890890 const content = parseJSON ( readFileSync ( filename ) , filename ) ;
891891
892892 if ( ! Array . isArray ( content ) ) {
@@ -1036,7 +1036,7 @@ export const kvBulkDeleteCommand = createCommand({
10361036 async handler ( { filename, ...args } ) {
10371037 const localMode = isLocal ( args ) ;
10381038 const config = readConfig ( args ) ;
1039- const namespaceId = getKVNamespaceId ( args , config ) ;
1039+ const namespaceId = await getKVNamespaceId ( args , config , localMode ) ;
10401040
10411041 if ( ! args . force ) {
10421042 const result = await confirm (
0 commit comments