![èŠåºãç»å](https://assets.st-note.com/production/uploads/images/94908366/rectangle_large_type_2_b651f7db66fbde2de9154b36a6891fe7.png?width=1200)
ðãæ£æãšããã°...ãããããšããcli-kintoneãã€ãã£ãŠã¿ãïŒð°
cli-kintoneãšããååãèããããšãããã
ããŒã£ãš
ãããããšãã«äŒŒãŠããŠçŸå³ããããšæã£ãŠãŸããã
ãããäœãªã®ãã¯ïŒ£ïŒ€ïŒ®â»ãèŠãŠåããŠããããŸããã
ãã£ãããªã®ã§ã¡ãã£ãšè§Šã£ãŠã¿ãããšæããŸãïŒ
â»CDN
cybozu developer networkïŒkintoneãã«ã¹ã¿ãã€ãºïŒJavaScriptãšãAPIãšãïŒããããã®è²ããªæ å ±ãæäŸããŠãããµã€ã
ä»åããã¡ãã®èšäºãåèã«ããŸãã
ãâãâãâ
kintone ã³ãã³ãã©ã€ã³ããŒã«ïŒcli-kintoneïŒhttps://developer.cybozu.io/hc/ja/articles/10663181361689
cli-kintone ãšã¯
cli-kintone ãšã¯
kintone ã³ãã³ãã©ã€ã³ããŒã«ïŒcli-kintoneïŒã¯ãã³ãã³ã㧠kintone ã®ã¬ã³ãŒãæ å ±ãå ¥åºåã§ããããŒã«ã§ãã
ã³ãã³ãã©ã€ã³ããŒã«ãšããŠæäŸãããŠãããããã·ã§ã«ã¹ã¯ãªãããã¡ã€ã«ããåŒã³åºããŠå®è¡ã§ããŸãã
ã¬ã³ãŒãæ å ±ã®å ¥åºåã ãã§ãªããkintone ã®ç»é¢ããã¬ã³ãŒããäžæ¬ç»é²ã»æŽæ°ããæ©èœã§ã¯ã§ããªãã次ã®æäœãã§ããŸãã
äžæ¬ã§ã¬ã³ãŒãã®æ·»ä»ãã¡ã€ã«ãããŠã³ããŒãããã
äžæ¬ã§æ·»ä»ãã¡ã€ã«ãã¬ã³ãŒãã«æ·»ä»ããã
ã³ãã³ãã©ã€ã³ãšãããããããããšã¯ããããŸãããã
kintoneã®æšæºæ©èœã§ã§ããªãããšãã§ããããã§ãã
ããããã°ããã©ã°ã€ã³ãã«ã¹ã¿ãã€ãºã䜿ããšãã¢ããªéã®ããŒã¿æäœã ã£ãããç»åäžæ¬ç»é²ãšãæšæºæ©èœã§ã§ããªãããšãã§ããããã«ãªããŸãã
ãªãã ãããšçåã ã£ãã®ã§ããããããã¯Webäžã§æãã»ä»ããŒã¿ããŒã¹ãããŒã«ã«ç°å¢ã®ããŒã¿ãäœãšãããã®ãå¯èœã«ããããã°ã©ã ãªãã§ããã
ã¢ããªã®ããŒã¿ã®å ¥åºå
ããŒã¿ã®å ¥åºåã«ã¯ãCSV圢åŒã®ãã¡ã€ã«ã䜿çšããŸãã
https://jp.cybozu.help/k/ja/id/04056.html#appdata
â»æ·»ä»ãã¡ã€ã«ã¯æšæºæ©èœã§ã¯ãèŠäºã«å ¥ååºåã§ããŸããã
ãããŠä»åãç®ãä»ããã®ã¯ãäžæ¬ã§æ·»ä»ãã¡ã€ã«ãã¬ã³ãŒãã«æ·»ä»ãããæ©èœããã£ãŠã¿ãããŒïŒ
ãã·ã§ã«ã¹ã¯ãªãããçµãã°äœæ¥ãèªååã§ããã®ãããããŒããã®ããïŒããšåž«å ãèšã£ãŠãããšããã䜿ãããªãã°äŸ¿å©ã«ãªããããã§ãã
â»ã·ã§ã«ã¹ã¯ãªããã«ã€ããŠã¡ã¢ã¡ã¢
ã·ã§ã«ã¹ã¯ãªãã (è±èª: shell script) ã¯äž»ã«ãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã®ã·ã§ã«ãŸãã¯ã³ãã³ãã©ã€ã³ã€ã³ã¿ããªã¿ããå®è¡å¯èœãªã³ãã³ãã®äžé£ã®æµãããã¡ã€ã«ã«ããŠåå©çšã§ããããã«ãããã®ã§ãããç矩ã§ã¯ãUnixã·ã§ã«ã§çšããããã¹ã¯ãªããèšèªãæããã·ã§ã«ã¹ã¯ãªããã¯ä»ã®ã³ãã³ããçµã¿åãããããã®ã°ã«ãŒåã®ãã¡ã€ã³åºæèšèªãšã¿ãªãããããšããããã·ã§ã«ã¹ã¯ãªããã§æžãããå žåçåŠçãšããŠã¯ããã¡ã€ã«æäœãããã°ã©ã å®è¡ãããã¹ãã®å°å·ãªã©ãããã
ã·ã§ã«ã¹ã¯ãªããçšã€ã³ã¿ããªã¿ã®å€ãã¯ã³ãã³ãã©ã€ã³ã€ã³ã¿ãã§ãŒã¹ãå ŒããŠãããåçš®Unixã·ã§ã«ãWindows PowerShellãMS-DOSã®COMMAND.COMãªã©ããããä»ã«AppleScriptãã°ã©ãã£ã«ã«ãª Windows Script Host (WScript.exe) ãªã©ããããã³ãã³ãã©ã€ã³ã€ã³ã¿ãã§ãŒã¹æãã§ã³ã³ãã¥ãŒãã£ã³ã°ç°å¢ã«ã¹ã¯ãªããæ©èœãå ããŠããã
ã·ã§ã« (è±èª: shell) ã¯ãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ïŒOSïŒããããããªé«æ©èœãªã³ã³ãã¥ãŒã¿ã«ãããŠããŠãŒã¶ãŒã®ããã«ã€ã³ã¿ãã§ãŒã¹ãæäŸããã³ã³ãã¥ãŒã¿ããã°ã©ã ã§ããããªãã¬ãŒãã£ã³ã°ã·ã¹ãã ãæäŸããæ©èœãžã®ã¢ã¯ã»ã¹ãæäŸãããä»ã«ãããã®çšèªã¯ããããã«å¿çšãããããšããããç¹å®ã®ã³ã³ããŒãã³ãã®åšèŸºã«æ§ç¯ãããä»»æã®ãœãããŠã§ã¢ãå«ãããšããããäŸãã°ããŠã§ããã©ãŠã¶ãé»åã¡ãŒã«ã¯ã©ã€ã¢ã³ãã¯HTMLã¬ã³ããªã³ã°ãšã³ãžã³ã®ãã·ã§ã«ããšããããããšããããã³ã³ãã¥ãŒã¿ã·ã¹ãã ãšãŠãŒã¶ãŒã®éã«ãããæ®»ãã§ããããšããããã®ããã«åŒã°ããã

âã²ããããããš
ã·ã§ã«ïŒOSïŒã®åäœã䟿å©ã«ãŸãšãããã®ãã·ã§ã«ã¹ã¯ãªããã¿ããã
ããããçé¢ç®ã«èŠãããªãèŠãŠãããããã¡ãã®èšäºãã³ãã³ãã©ã€ã³ãããã¡ãããšèª¬æããŠãããŠãŸããã¯ã£ããèšã£ãŠè¶
ããããããïŒ
ãâãâãâ
cli-kintoneã®æºå
ã§ã¯CDNã®æé ã«åŸã£ãŠcli-kintoneãå
¥ããŠã¿ãŸãããã
â»Windowsã®æé ã§ãã
âïŒã»ãŸãã¯GitHubããå
¥æ
![](https://assets.st-note.com/img/1672797875612-FaMSb5Ls3s.png?width=1200)
âïŒã»ãã¡ã€ã«ã解å
å®è¡ãã¡ã€ã«ãçŸããïŒïŒãã€ã¯ã©ãããã¯ã¿ããïŒ
![](https://assets.st-note.com/img/1672799672268-opc7Jgzfej.png?width=1200)
âïŒã»ã³ãã³ãããã³ãããèµ·å
ããŒãžã§ã³ç¢ºèªïŒ1.2.0ãçŸããïŒ
![](https://assets.st-note.com/img/1672800027014-CFiB5NGiLe.png?width=1200)
MinecraftèŸå žãã€ããããŒïŒ
ãäžæ¬ã§æ·»ä»ãã¡ã€ã«ãã¬ã³ãŒãã«æ·»ä»ããã
ããã§ãMinecraftèŸå
žãäœãããŒ
å
šã¢ã€ãã ïŒå
š1595çš®é¡ïŒïŒãã¡ãã¡ã¬ã³ãŒããäœãã®å€§å€ã
ã¬ã³ãŒãäžæ¬ç»é²/æŽæ°ã¯CSVã§ã§ãããã®ã®ãç»åãã©ãããïŒãšããã®ãæ©ã¿ã§ããã
ïŒã»ããšãã¯ãcli-kintone 䜿ã£ãŠã¿ããâãã€ã¯ã©ã®ç»åãç»é²ããŠã¿ããïŒã®æµãã§ãå®éã«ã¯æ©ãã§ã¯ããªãïŒ
ð°âææïŒä»¥åå
¥æããç»åãããã®ã§ãããã䜿ããŸãã
â»ããã¯æ°ãã£ã©ã®ã¢ããªã©ã§ããç·Žç¿ãšããŠäœ¿çš
![](https://assets.st-note.com/img/1672795604200-62ZQFkDS80.png?width=1200)
ð°âã¢ããããŒãããã¢ããªïŒ
âMinecraft èŸå
žâãšããã¢ããªãäœæ
ã»ååãå
¥ããæååïŒè¡ãã£ãŒã«ã
ã»æ·»ä»ãã¡ã€ã«ãã£ãŒã«ã
â»ä»åã¯æäœéã®ãã£ãŒã«ãã®ã¿ã§ãããããã¯ãããã¯ã³ãŒãã ã£ããå±æ§ã ã£ããããããªå
¥åãã£ãŒã«ããå
¥ããŠãããã§ããã
![](https://assets.st-note.com/img/1672800220186-hO57QepgSy.png?width=1200)
ã§ã¯ãã£ãŠã¿ãŸãããïŒ
åè¿°ã®CDNã®ãæ·»ä»ãã¡ã€ã«ãã¢ããããŒããããããã£ãŠãããŸãã
https://developer.cybozu.io/hc/ja/articles/10663181361689
ð°âïŒã»æ·»ä»ãã¡ã€ã«ã®å Žæ
âGIFStickersâãšããååã®ãã©ã«ãã«ç»åããããŸãã
ããããããã£ãé
眮ã§å
¥ããŠãããŸãã
æ·»ä»ãã¡ã€ã«ãã¢ããããŒãããŠã¬ã³ãŒãã«æ·»ä»ããã«ã¯ã
--attachments-dir ãªãã·ã§ã³ã«ã¢ããããŒããããã¡ã€ã«ãé 眮ãããã£ã¬ã¯ããªãŒãæå®ããŸãã
ãã£ã¬ã¯ããªãŒåã¯ãå®è¡ããŠããå Žæããã®çžå¯Ÿãã¹ã§ãã

ð°ä»åã¯ãããªæãã§ã
cli-kintone-win ã âcli-kintone.exe ããããã£ã¬ã¯ããªãŒ
âââ GIFStickersãâç»åãå ¥ã£ãŠãããã©ã«ã
âââ Alex.gif
âââ Allay.gif
âââ Character-boat.gifãâŠ

ããçžå¯Ÿãã¹âŠ?â»
åç §ããããã¡ã€ã«ãåäžéå±€ãåäžãã©ã«ãã«ããå Žå
--file-path ./example.csv ãâã©ãããããã¯ãåäžéå±€åäžãã©ã«ããè¡šãããã§ã
![](https://assets.st-note.com/img/1672877597096-kdDZCOxEZN.png)
ð°âïŒã»CSVãã¡ã€ã«ã®äœæ
ç»åã ãçšæããã°æ·»ä»ã§ãããšæã£ãŠãã®ã§ããããã£ãŒã«ããæå®ããªããšç¡çã§ããããã®ããã«ïŒ£ïŒ³ïŒ¶ãã¡ã€ã«ãäœæããŸãã
ããªãŸãããšãæ·»ä»ãã¡ã€ã«ããã£ãŒã«ããçšæããŸããã
ãããããååãšãã¡ã€ã«åãå
¥ããŸããâ»äžè¡ç®ã¯ãã£ãŒã«ãã³ãŒã
![](https://assets.st-note.com/img/1672803288960-RL5PFauPU5.png?width=1200)
ãšããã§ç»åãã¡ã€ã«ã®ååãã©ããã£ãŠç»é²ãããïŒ
ã²ãšã€ã²ãšã€ã³ããããŠCSVããŒã¿ã«å
¥åããŠãã£ãããäœèšãªæéã«ã
äœã®ããã®èªååãå
ãåããããŸããã
ãã¶ãã£ãããŒãããšåž«å ã«æãããŸãã
ãããã³ãã³ãããã³ããã§æäœããããšã§è§£æ±ºïŒ
ä»å䜿ã£ãã³ãã³ã
dir /b /a-d | clip
dirãâãã¡ã€ã«ã®äžèŠ§ã衚瀺ããã
/bãâãã¡ã€ã«åã ãã衚瀺ããã
/a-dãâãã£ã¬ã¯ããªãé€ã
| clipãâã¯ãªããããŒãã«ã³ããŒãã
ãã¡ã€ã«åäžèŠ§ãã²ããïŒãã®ãŸãŸCSVãã¡ã€ã«ã«æ·»ä»ã§ããïŒ
â»åèïŒWindowsã³ãã³ãèã®å·»
https://windows.command-ref.com/cmd-dir.html
ð°âïŒã»ã¬ã³ãŒããè¿œå ãã
ã¬ã³ãŒããè¿œå ãŸãã¯æŽæ°ããã«ã¯ãrecord importãæå®ããŸãã
ãŸãã次ã®ãªãã·ã§ã³ã«ãæäœãã kintone ã®ãã¡ã€ã³åãšã¢ã㪠ID ãæå®ããŸãã
â--base-urlïŒæäœãã kintone ã®ãã¡ã€ã³åïŒäŸïŒhttps://sample.cybozu.comïŒ
â--appïŒã¢ã㪠IDïŒäŸïŒ123ïŒ
â--file-pathïŒè¿œå ããã¬ã³ãŒãã®æ å ±ãèšèŒãã CSV ãã¡ã€ã«ã®ãã¹

ð°ä»åã¯ãããªæãã§ã
cli-kintone.exe record import
--base-url https://ÃÃÃ.cybozu.com
--app 21 \
--api-token ÃÃÃ \
--file-path ./minecraftappname.csv \
--attachments-dir ./GIFStickers
ãããã
ãã€ã¯äœåºŠããšã©ãŒã«âŠåå ã¯ãã®ãããªããšããããŸããã
ã»ããããããŠã³ããŒããããã¡ã€ã«ãééããŠãã
ïŒWindowsãªã®ã«LinuxïŒ
ã»APIããŒã¯ã³ããããã«å®è¡
ã»â \âãä»ãããšãããšã©ãŒ
ïŒããã¯æ¹è¡ã®ããã«ã€ããŠãããã®ãªã®ã§ãä»åã¯äžèŠãšã®ããšïŒ
ã»åãªãã¹ãã«ãã¹
ãããªãããªã§æ³å®ããïŒåã®æéãããã£ãããã§ããã
ãªãã ãåãããâŠ
ãããŠ
Successfullyã®æåãïŒ
![](https://assets.st-note.com/img/1672878272854-nrLwrZII72.png)
ã¢ããªãæŽæ°ããŠã¿ããšâŠ
![](https://assets.st-note.com/img/1672878328416-O60f4DwfWq.png?width=1200)
ç»åãšååã®ããŒã¿ãç»é²ãããŸããïŒïŒïŒ
ããããããããããšãïŒïŒ
ãïŒã¢ã¬ãã¯ã¹ã ãç»åã衚瀺ãããŠããªãã®ã¯âŠ
![](https://assets.st-note.com/img/1672878422165-37k5oX5Vtj.png?width=1200)
kintoneãã«ãã«ãããããã§ããã
ç»åã®ãµã ãã€ã«ã®ä»æ§ã§ãã
確ãã«ã¢ã¬ãã¯ã¹ã ã10MBè¶
ããŠãããç¥ã£ãŠãŠããã£ãïŒ
ç»åã®ãã¡ã€ã«ãµã€ãºã10MBãè¶ ããå Žåã¯ããµã ãã€ã«ã®èšå®ã«é¢ãããããã¡ã€ã«åã衚瀺ãããŸãããµã ãã€ã«ã¯è¡šç€ºãããŸããã
https://jp.cybozu.help/k/ja/user/app_settings/app_othersettings/set_thumbnail.html
ãããã¯MinecraftWikiã«ããå šã¢ã€ãã ã®ã¬ã³ãŒããç»é²ããããªïŒïŒ
以äžãâåå¿è
ã調ã¹ãªãããã£ãŠã¿ãâããããããªãæéãããã£ãŠããŸããŸããããã³ãããããã°ããããã§ãããã§ãã
ããããããæ©äŒãããã°cli-kintoneã䜿ã£ãŠã¿ãããšæããŸãïŒ
ãã®èšäºãæ°ã«å ¥ã£ãããµããŒããããŠã¿ãŸãããïŒ