@@ -188,7 +188,7 @@ export const kvNamespaceDeleteCommand = createCommand({
188188 printResourceLocation ( "remote" ) ;
189189 let id ;
190190 try {
191- id = getKVNamespaceId ( args , config ) ;
191+ id = await getKVNamespaceId ( args , config , false ) ;
192192 } catch ( e ) {
193193 throw new CommandLineArgsError (
194194 "Not able to delete namespace.\n" + ( ( e as Error ) . message ?? e )
@@ -383,7 +383,7 @@ export const kvKeyPutCommand = createCommand({
383383 async handler ( { key, ttl, expiration, metadata, ...args } ) {
384384 const localMode = isLocal ( args ) ;
385385 const config = readConfig ( args ) ;
386- const namespaceId = getKVNamespaceId ( args , config ) ;
386+ const namespaceId = await getKVNamespaceId ( args , config , localMode ) ;
387387 // One of `args.path` and `args.value` must be defined
388388 const value = args . path
389389 ? readFileSyncToBuffer ( args . path )
@@ -495,7 +495,7 @@ export const kvKeyListCommand = createCommand({
495495 const localMode = isLocal ( args ) ;
496496 // TODO: support for limit+cursor (pagination)
497497 const config = readConfig ( args ) ;
498- const namespaceId = getKVNamespaceId ( args , config ) ;
498+ const namespaceId = await getKVNamespaceId ( args , config , localMode ) ;
499499
500500 let result : NamespaceKeyInfo [ ] ;
501501 let metricEvent : EventNames ;
@@ -586,7 +586,7 @@ export const kvKeyGetCommand = createCommand({
586586 async handler ( { key, ...args } ) {
587587 const localMode = isLocal ( args ) ;
588588 const config = readConfig ( args ) ;
589- const namespaceId = getKVNamespaceId ( args , config ) ;
589+ const namespaceId = await getKVNamespaceId ( args , config , localMode ) ;
590590
591591 let bufferKVValue ;
592592 let metricEvent : EventNames ;
@@ -678,7 +678,7 @@ export const kvKeyDeleteCommand = createCommand({
678678 async handler ( { key, ...args } ) {
679679 const localMode = isLocal ( args ) ;
680680 const config = readConfig ( args ) ;
681- const namespaceId = getKVNamespaceId ( args , config ) ;
681+ const namespaceId = await getKVNamespaceId ( args , config , localMode ) ;
682682
683683 logger . log ( `Deleting the key "${ key } " on namespace ${ namespaceId } .` ) ;
684684
@@ -753,7 +753,7 @@ export const kvBulkGetCommand = createCommand({
753753 async handler ( { filename, ...args } ) {
754754 const localMode = isLocal ( args ) ;
755755 const config = readConfig ( args ) ;
756- const namespaceId = getKVNamespaceId ( args , config ) ;
756+ const namespaceId = await getKVNamespaceId ( args , config , localMode ) ;
757757
758758 const content = parseJSON ( readFileSync ( filename ) , filename ) as (
759759 | string
@@ -895,7 +895,7 @@ export const kvBulkPutCommand = createCommand({
895895 // but we'll do that in the future if needed.
896896
897897 const config = readConfig ( args ) ;
898- const namespaceId = getKVNamespaceId ( args , config ) ;
898+ const namespaceId = await getKVNamespaceId ( args , config , localMode ) ;
899899 const content = parseJSON ( readFileSync ( filename ) , filename ) ;
900900
901901 if ( ! Array . isArray ( content ) ) {
@@ -1045,7 +1045,7 @@ export const kvBulkDeleteCommand = createCommand({
10451045 async handler ( { filename, ...args } ) {
10461046 const localMode = isLocal ( args ) ;
10471047 const config = readConfig ( args ) ;
1048- const namespaceId = getKVNamespaceId ( args , config ) ;
1048+ const namespaceId = await getKVNamespaceId ( args , config , localMode ) ;
10491049
10501050 if ( ! args . force ) {
10511051 const result = await confirm (
0 commit comments